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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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