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

How to replace content of file


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

New User


Joined: 03 Sep 2007
Posts: 1
Location: Hyderabad

PostPosted: Tue May 19, 2009 4:44 pm
Reply with quote

Suppose the record structure in my input file is

abcdxxgauravxxxar
xxgauravxxxxxlmno
xxxxxxxxxxgauravx

and i want 'gaurav' to be replaced by 'deep'
i want output as

abcdxxdeepxxxxxar
xxdeepxxxxxxxlmno
xxxxxxxxxxdeepxxx
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 19, 2009 5:17 pm
Reply with quote

FINDREP function in DFSORT will serve your purpose....
Check documentation at below link..

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 19, 2009 6:33 pm
Reply with quote

in the event that your shop is not up to date with DFSORT releases
there are alternative methods here
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 19, 2009 8:35 pm
Reply with quote

Dick,

That alternate method (TRAN=ALTSEQ) only works for replacing one character with another. It can't be used to replace a word with another word. That requires FINDREP.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 19, 2009 8:37 pm
Reply with quote

Quote:
i want 'gaurav' to be replaced by 'deep'


From the example you show, it appears you actually want 'gaurav' to be replaced by 'deepxx'. You could use these DFSORT control statements to do that:

Code:

  OPTION COPY                                   
  INREC FINDREP=(IN=C'gaurav',OUT=C'deepxx')   
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 19, 2009 9:03 pm
Reply with quote

thx Frank, I miss-interpreted what was going on in the other post.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top