Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) you can do this much more easily using the new JFY function.
Here's two different DFSORT jobs that will do it:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Build NUMBER '
INREC BUILD=(C'NUMBER ''',
* use JFY to build data'.
* TRAIL=C'''' puts a ' after the last nonblank of data.
1,5,JFY=(SHIFT=LEFT,TRAIL=C''''))
/*
Code:
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Use JFY to build NUMBER 'data'.
* LEAD puts NUMBER ' before data.
* TRAIL puts a ' after the last nonblank of data.
INREC BUILD=(1,13,JFY=(SHIFT=LEFT,LEAD=C'NUMBER ''',
TRAIL=C''''))
/*
For complete information on the JFY function, see:
i don't know how to deal with the qoutes but here is a sample on how to add the word number... I'll get back to you once i Hav learned how to deal with the quotes.
Code:
//IEBGEN01 EXEC PGM=IEBGENER
//SYSUT1 DD *
ONE
TWO
THREE
FOUR
FIVE
//SYSUT2 DD SYSOUT=*
//SYSIN DD *
GENERATE MAXFLDS=2,MAXLITS=80
RECORD FIELD=(73,1,,8),
FIELD=(6,'NUMBER',,1)
//SYSPRINT DD SYSOUT=*