Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Two-step process.
First, you take your date file and generate a sort symbol/SYMNAME from it. Be aware that the file where you generate the symbol must have fixed-length 80-byte records, so end your BUILD with 80:X) is a good way to do that.
Second, extend your variable-length records, after the RDW, to include enough space for a sequence number which is big enough for the number of records your file can contain. Put a sequence number there. When the sequence number is two, do an OVERLAY to put the date symbol in the position you requiure.
Ensure that your records are then restored to their original size without the extension. |
|
rinsio
New User
Joined: 16 Feb 2015 Posts: 13 Location: Madrid, Spain
|
|
|
|
Hello nareshkareti
There is another option but you shuld give us more detalis. For example
is the detail record identified? I think a solution thinking about the types of record have identifications. I simulate FB file. You could make the changes you need.
Code: |
000015 //PASO001 EXEC PGM=SORT,COND=(0,NE)
000016 //SYSOUT DD SYSOUT=*
000017 //SORTIN DD *
000018 05052014
000019 /*
000020 //SORTOUT DD DSN=DESXXX.MAINFR.SALIDA,
000021 // DISP=(,CATLG,DELETE),
000022 // SPACE=(TRK,(10,10),RLSE),
000023 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
000024 //SYSIN DD *
000025 SORT FIELDS=COPY
000026 OUTREC FIELDS=(3X,C'OVERLAY=(9:C',X'7D',1,08,X'7D',
000027 C'))',53X)
000028 /*
000029 //***********
000030 //PASO002 EXEC PGM=SORT,COND=(0,NE)
000031 //SYSOUT DD SYSOUT=*
000032 //SORTIN DD *
000033 HEADER1234
000034 ABCDEFGH10102014QUERTY
000035 TRAILER1234
000036 /*
000037 //SORTOUT DD DSN=DESXXX.MAINFR.SALIDA1,
000038 // DISP=(,CATLG,DELETE),
000039 // SPACE=(TRK,(10,10),RLSE),
000040 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
000041 //SYSIN DD *
000042 SORT FIELDS=COPY
000043 OUTFIL FNAMES=SORTOUT,
000044 IFTHEN=(WHEN=(01,1,CH,EQ,C'A'),
000045 // DD DSN=DESRIB.MAINFR.SALIDA,DISP=SHR |
Code: |
OUTPUT FILE
BROWSE DESXXX.MAINFR.SALIDA1 Line 00000000 Col 001 080
Command ===> Scroll ===> CSR
********************************* Top of Data *********************************
HEADER1234
ABCDEFGH05052014QUERTY
TRAILER1234
******************************** Bottom of Data ******************************* |
Best regards
Code'd |
|