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
 
How to replace certain fields in a particular record?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 44
Location: Bangalore

PostPosted: Wed May 14, 2008 6:31 am    Post subject: How to replace certain fields in a particular record?
Reply with quote

Hi,

I have an input file sorted on certain fields. I want to replace certain fields in some particular records(depending on certain condition), with some other values. I'll explain with example.

Infile:

aaa12df345vhk67
vjv13b,ug,bml;67
cvm12,mcvbk366
bax13vxcbmluj66

if the 14th and 15th position values are 66 and 4th and 5th position values asre 13, i should replace tha value 13 with 55.
i.e, the forth d should be

bax55cbmluj66, and all the rest should be as such.

Thanks,
Reni
Back to top
View user's profile Send private message
References
PostPosted: Wed May 14, 2008 6:31 am    Post subject: Re: How to replace certain fields in a particular record? Reply with quote

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 547

PostPosted: Wed May 14, 2008 7:07 am    Post subject:
Reply with quote

Hi Reni,

Try this DFSORT job

Code:
//STEP1    EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
AAA12DF345VHK67                                                     
VJV13B,UG,BML;67                                                     
CVM12,MCVBK366                                                       
BAX13VXCBMLUJ66                                                     
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=(14,2,CH,EQ,C'66',AND,4,2,CH,EQ,C'13'),         
        OVERLAY=(4:C'55'))                                         
/*                                                                   


Gerry
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