shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Hi All,
I need your valuable suggestion for the situation mentioned below.
There are two input files as shown below.
Input File 1: 20040328XXXXXXXXXX
Input File 2: Contains 5 lines, in that I just want to have the date i.e. 20040328 (from the Input File 1) to be overlaid on the 4th line of the
Input File 2 at the position 15 ? 22 to get the Single Output File.
Though it can be done by a work around involving more than one SYNCSORT step, Can this be done using a single SYNCSORT step?
Can anyone help me with any type of sort?
Thanks in advance.
Shri |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Shri asked me offline how to do this with DFSORT. In case anybody else is interested, here's the DFSORT job I offered:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1 (FB/80)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT symbol:
* mydate,'yyyymmdd'
OUTREC BUILD=(C'mydate,''',1,8,C'''',80:X)
/*
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2 (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
* Add seqnum in 81-82.
* If seqnum is 4, overlay 15-22 with mydate.
* Remove seqnum.
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,2,ZD)),
IFTHEN=(WHEN=(81,2,ZD,EQ,+4),OVERLAY=(15:mydate))
/*
|
|
|