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
 

 

Selecting matching records and replacing some fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Silpha

New User


Joined: 15 May 2007
Posts: 5
Location: Trivandrum

PostPosted: Tue May 06, 2008 10:31 am    Post subject: Selecting matching records and replacing some fields
Reply with quote

Requirement

I have two files(F1, F2) of LRECL 80. The key field is first 2 bytes.
I want matching records of F2 to be written to the output file(F3).
The records of F3 is not exactly same as of F2. I want to replace 5 to 10 bytes of F2 by 5 to 10 bytes of F1 before writing it into F3.

Please find below the example. I am listing only the first 10 bytes.

F1

01aa1000dd
02bb2000ee
03cc3000ff

F2

01dd4000gg
03ee5000hh

F3

01dd1000dd
03ee3000ff
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue May 06, 2008 12:50 pm    Post subject: Re: Selecting matching records and replacing some fields
Reply with quote

Hi,

Try this JOB,
Code:
//DFSORT  EXEC PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN1     DD *                                                       
01AA1000DD                                                           
02BB2000EE                                                           
03CC3000FF                                                           
//IN2     DD *                                                       
01DD4000GG                                                           
03EE5000HH                                                           
//TMP1    DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT     DD SYSOUT=*                                               
//TOOLIN  DD *                                                       
  COPY FROM(IN2) TO(TMP1) USING(CPY1)                               
  COPY FROM(IN1) TO(TMP1) USING(CPY2)                               
  SPLICE FROM(TMP1) TO(OUT) ON(1,2,CH) WITH(5,6)                     
//CPY1CNTL DD *                                                     
  OUTREC FIELDS=(1:1,4,5:6X)                                         
/*                                                                   
//CPY2CNTL DD *                                                     
  OUTREC FIELDS=(1:1,4,5:5,6)                                       
/*                                                                   
Back to top
View user's profile Send private message
Silpha

New User


Joined: 15 May 2007
Posts: 5
Location: Trivandrum

PostPosted: Tue May 06, 2008 3:13 pm    Post subject: Reply to: Selecting matching records and replacing some fiel
Reply with quote

Thanks a lot Anuj. It worked icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue May 06, 2008 9:27 pm    Post subject:
Reply with quote

Hi,

You are welcome, Well I had to solve this..coz once upon a time "Silpha" was name of my P.M. .. icon_smile.gif
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am


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