FileMaster

 View Only

 filemaster Custom record layouts substrings ???

Jump to  Best Answer
Derez Lusk's profile image
Derez Lusk posted Jun 09, 2022 10:13 AM
is there a way to  Reference  a field  in the custom record layout      

for example   field-a  in Copybook  Recout     contains  20 characters  
                      field-b  in Copybook  Recindx    contains  15 characters 

the corresponding  item is  the last 3 characters of  field-a  to  map the record   to recout 
the corresponding  item is the  1st 3 characters of  field-b  to map the record  to  Recindx  

is there a way to do this without getting any syntax errors  or **** layouts  

cotpa01's profile image
Broadcom Employee cotpa01  Best Answer
Hello Derek, 

I understand you wish option 6.U could generate Custom Record Layouts with sub-stringing as in the below.
The layout feature does not support sub-stringing at this time. The workaround would be you create copybooks where fielda and fieldb are further detailed and the CRL would reference the appropriate sub-field. 

You suggestion is worth consideration, particularly if other users back it! 

Thanks
Patrice Cotte
File Master Architect

*** CA File Master Plus             12.0.0   Custom Record Layout 
"Test"                                                            
* 12.0                                                            
  IF=(RECINDX-FIELDB(1:3) = T'xyz')                               
    LAYOUTFILE=MY.COPYLIB(RECINDX)                                
    LAYOUTREC=RECINDX-RECORD                                      
* 12.0                                                            
  IF=(RECOUT-FIELDA(1:3) = C'abc')                                
    LAYOUTFILE=MY.COPYLIB(RECOUT)                                 
    LAYOUTREC=RECOUT-RECORD                                       ​
cotpa01's profile image
Broadcom Employee cotpa01
Good morning Derek,

If I'm correct you wish option 6 would generate something like the below in order to select a copybook based on a sub-string of a field. 
Unfortunately the product does not support filed sub-stringing. 

The work-around is you create 'augmented' copybooks that redefine fielda or fieldb into sub-fields and you select on the sub-field.

This request makes sense and is worth considering if other users vote for it. 

Thanks
Patrice Cotte
FileMaster Architect



*** CA File Master Plus             12.0.0   Custom Record Layout  
"Test"                                                             
* 12.0                                                             
  IF=(RECINDX-FIELDB(1:3) = T'xyz')                                
    LAYOUTFILE=MY.COPYLIB(RECINDX)                                 
    LAYOUTREC=RECINDX-RECORD                                       
* 12.0                                                             
  IF=(RECOUT-FIELDA(1:3) = C'abc')                                 
    LAYOUTFILE=MY.COPYLIB(RECOUT)                                  
    LAYOUTREC=RECOUT-RECORD                                        ​
Derez Lusk's profile image
Derez Lusk
Thank you ,  i was trying if 2,3,c'xyz'  and getting a  error