IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Overlay to override the date in second file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vibha Upadhyay

New User


Joined: 17 Mar 2011
Posts: 8
Location: India

PostPosted: Fri Oct 07, 2011 11:35 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 07, 2011 12:10 pm
Reply with quote

Yes, try to search/browse the forum, there is a similar thing from a few weeks ago.
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Fri Oct 07, 2011 2:04 pm
Reply with quote

Show us the exact Input files and its File format and rec lenghts.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Fri Oct 07, 2011 2:46 pm
Reply with quote

Take a look here

You can do it in a single step using ICETOOL.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Oct 07, 2011 2:55 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 07, 2011 10:50 pm
Reply with quote

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.

Code:

20110812   


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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top