View previous topic :: View next topic
|
Author |
Message |
silentarya
New User
Joined: 11 Mar 2007 Posts: 35 Location: Chennai
|
|
|
|
I have two datasets. In one the date(8th-17th position) is populated incorrectly which is anlysed by a different division. I have to make a temp fix by introducing a temp step which uses SORT. In this step i have to copy only the date part from a second dataset(16th-25th position) to the incorrect dataset (8th-17th position) as a temp fix so as stop the job abend. The change is to only reflect in the first row i.e. the header part and that to only the date part. Please suggest some solution.
DAILY1
HDR 2010-12-20 2010-12-21 2010-12-22
Data1
Data2
.
.
.
.
.
.
TRLR Total 735
MONDAY2
HDR SZ 2010-12-20
Data1
Data2
.
.
.
.
.
.
TRLR Total 200 |
|
Back to top |
|
|
silentarya
New User
Joined: 11 Mar 2007 Posts: 35 Location: Chennai
|
|
|
|
Daily1 and Monday2 are the two datasets in the above example |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I see three dates in DAILY1 file and one date in MONDAY2 file. I can't tell from your description or example which date is to be replaced with which other date. Which file is the bad date in? Which file is the good date in? Which of the three dates in the DAILY1 file is the incorrect or correct date?
The positions you mentioned don't help since you didn't use ubb code tags to show the actual positions in your example.
Please show what you expect for output. Please use ubb code tags for your input and output examples to show the actual positions of the fields.
Also, what is the RECFM and LRECL of each input file? |
|
Back to top |
|
|
Guest
|
|
|
|
Hi,
Based on my understanding of your requirement I have written this two steps to attain the solution you asked for:
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
HDR 2010-12-20 2010-12-21 2010-12-22
DATA1
DATA2
//SORTOUT DD DSN=TEMP.DAT,DISP=(,CATLG),
// LRECL=80,
// RECFM=FB
//SYSIN DD *
OPTION COPY,STOPAFT=1
OUTREC FIELDS=(C'DATS,''',16,10,C'''',63X)
/*
//*
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=TEMP.DAT,DISP=SHR
//SORTIN DD *
HDR SZ 2010-12-20
DATA1
DATA2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),
OVERLAY=(8:DATS))
/*
|
The output of the same is:
Code: |
HDR SZ 2010-12-21
DATA1
DATA2
|
Let me know if my understanding is right.
Devil13
There is always a better solution |
|
Back to top |
|
|
silentarya
New User
Joined: 11 Mar 2007 Posts: 35 Location: Chennai
|
|
|
|
Thanks Devil |
|
Back to top |
|
|
|