View previous topic :: View next topic
|
Author |
Message |
Vibha Upadhyay
New User
Joined: 17 Mar 2011 Posts: 8 Location: India
|
|
|
|
Hi all,
I need help on the below requirement:
I have a date field written on to a file(lets say Date file). And I have another file B which has several fields.I need the date from the date file to override the date present in file B for each record of File B. The date field is between other columns in file B. Is this possible using DFSORT alone?
I was thinking of writing the date to a temp file and then use OVERLAY to override the date in second file with the one in the date file. But I am not sure if the same is possible. I did try it and was getting syntax error in the OVERLAY statement.
Any help/suggestions on this are greatly appreciated.
Thanks
Vibha |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, try to search/browse the forum, there is a similar thing from a few weeks ago. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
Show us the exact Input files and its File format and rec lenghts. |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Take a look here
You can do it in a single step using ICETOOL. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use symnames dataset to set your date
Code: |
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
MYDATE,'20111007'
//SORTIN DD *
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAXDATEDATEXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(10:MYDATE)
/*
|
Output will be..
Code: |
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
AAAAAAAAX20111007XXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Vibha,
Quote: |
I have a date field written on to a file(lets say Date file). |
Ok, let's assume this date file has one record with the date in positions 1-8, e.g.
You can create a symbol for this date and use it to overlay the date field in file B with a DFSORT job like this:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... date file (FB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'MYDATE,''',1,8,C'''',80:X)
//S2 EXEC PGM=SORT
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAAA20101213QQ
BBBB20101215RR
CCCC20110112SS
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(5:MYDATE)
/*
|
SORTOUT would have:
Code: |
AAAA20110812QQ
BBBB20110812RR
CCCC20110812SS
|
If you need more help on this, give the RECFM and LRECL of each file and show what the records in each file look like and what you want for output. |
|
Back to top |
|
|
|