IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to replace certain fields in a particular record?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Chennai

PostPosted: Wed May 14, 2008 6:31 am
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: 1702
Location: Australia

PostPosted: Wed May 14, 2008 7:07 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top