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
 

 

Header date to be replaced from another dataset header date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Header date to be replaced from another dataset header date
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    Post subject: Reply to: Header date to be replaced from another dataset he
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 Moderator


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

PostPosted: Fri Dec 31, 2010 12:24 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Header date to be replaced from another dataset he
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    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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


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