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

Header date to be replaced from another dataset header date


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

New User


Joined: 11 Mar 2007
Posts: 35
Location: Chennai

PostPosted: Thu Dec 30, 2010 6:53 pm
Reply with quote

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

New User


Joined: 11 Mar 2007
Posts: 35
Location: Chennai

PostPosted: Thu Dec 30, 2010 6:54 pm
Reply with quote

Daily1 and Monday2 are the two datasets in the above example
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 Dec 31, 2010 12:24 am
Reply with quote

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







PostPosted: Fri Dec 31, 2010 9:56 am
Reply with quote

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

PostPosted: Fri Dec 31, 2010 2:18 pm
Reply with quote

Thanks Devil
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top