Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use these DFSORT steps to get the date from file1 and use it in file2:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file with date (FB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
* Create DFSORT symbol as:
* MYDATE,'yy/mm/dd'
OPTION COPY,STOPAFT=1
OUTREC BUILD=(C'MYDATE,''',4,8,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
...
OUTREC FIELDS=(C'IRO',
C' ',
MYDATE,
...
/*
|
You don't need all those IFTHENs to replace each 'A' in a field with a blank. Instead, you can use DFSORT's TRAN=ALTSEQ feature as follows:
Code: |
ALTSEQ CODE=(C140)
OUTREC ...
...
p,m,TRAN=ALTSEQ,
...
|
where p is the starting position and m is the length.
For more information on using TRAN=ALTSEQ, see the "Change all zeros in your records to spaces" Smart DFSORT Trick at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/index.html
To learn more about all the things you can do with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|