Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
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
References
PostPosted: Tue May 06, 2008 10:31 am    Post subject: Re: Selecting matching records and replacing some fields Reply with quote

Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1309
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 D.

Senior Member


Joined: 22 Apr 2006
Posts: 1309
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1