Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Overlay to override the date in second file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Overlay to override the date in second file
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7308

PostPosted: Fri Oct 07, 2011 12:10 pm    Post subject: Reply to: Overlay
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Overlay
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 Moderator


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

PostPosted: Fri Oct 07, 2011 10:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us