Lean Beginner
Joined: 07 Aug 2012 Posts: 37 Topics: 11
|
Posted: Wed Nov 25, 2015 8:32 pm Post subject: JOINKEYS REFORMAT question |
|
|
Purpose : File3 has paired records from file1 and is the same length as file1.
If file1 length is changed from 69 to 70, I have to update REFORMAT FIELDS=(F1:1,70) manually.
I’m wondering if there’s a way ‘NOT to hard code the file3 length, it can be changed automatically’.
Code: |
//STEP02B EXEC PGM=SORT,REGION=8M,COND=(4,LT)
//SORTJNF1 DD DISP=SHR,DSN=file1 –FB file
//SORTJNF2 DD DISP=SHR,DSN=file2 –FB file
//SORTOUT DD DSN=file3, -- FB file
// DISP=(NEW,CATLG,DELETE),SPACE=&SPLG,UNIT=SYSDA,
// DCB=*.SORTJNF1
//SYSOUT DD SYSOUT=4
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(13,20,A)
JOINKEYS FILE=F2,FIELDS=(1,20,A)
REFORMAT FIELDS=(F1:1,69) F1:1,70 current approach
SORT FIELDS=COPY
|
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Thu Nov 26, 2015 9:40 am Post subject: |
|
|
For fixed-length records, no.
The best you can do (which is a good thing) is to have symbols for your data. Ensure you have a symbol which defines a field the size of the record, then use that symbol everywhere you need to refer to an entire record on that file. Then you only have one place to change the size, in the definition of the symbol. |
|