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
 

 

How to replace certain fields in a particular record?

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

New User


Joined: 13 Apr 2007
Posts: 59
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

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

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
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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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