fatmonster wrote:I found the new function in V2R1, thanks BillyBoyo!!
But how about other methods?
"Insert a string at the end of variable-length records
VLTRAIL=string is a new OUTFIL option that allows you to insert a character
string (C'string') or hexadecimal string (X'yy...yy') at the end of each variable-length
OUTFIL output record."
Fatmonster,
If you have V2R1 then it is a simple 1 keyword function. If you do not have DFSORT V2R1, then you can still do it but it requires as little bit of work depending on how your input data is.
you can use the following control cards
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(256:X)
OUTFIL VLTRIM=C' ',
BUILD=(1,4,5,252,JFY=(SHIFT=LEFT,TRAIL=X'FF'))
//*
Alternatively You can write an exit or generate dynamic sysin control cards checking the rdw for its length.
Here is a sample JCL to generate the sysin control cards.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REPEAT=252,IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,3,ZD,START=4,
85:SEQNUM,3,ZD,START=5)),
IFTHEN=(WHEN=INIT,
OVERLAY=(9:C'IFTHEN=(WHEN=(1,2,BI,EQ,',81,3,C'),OVERLAY=(',85,3,
C':X''',C'FF''',C')),')),
IFTHEN=(WHEN=(81,3,ZD,EQ,004),BUILD=(003:C'OPTION COPY')),
IFTHEN=(WHEN=(81,3,ZD,EQ,005),OVERLAY=(003:C'INREC')),
IFTHEN=(WHEN=(81,3,ZD,EQ,255),OVERLAY=(058:X))
//*