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

substring replacement in a record


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

New User


Joined: 20 Mar 2006
Posts: 2
Location: hyderabad

PostPosted: Mon Mar 23, 2009 11:17 pm
Reply with quote

Hi,

Please advise, do we have equivalent code in SORT/ICETOOL as we do in cobol - INSPECT string CONVERTING substring1 TO substring1.

Example:
Input file has:
first&name
l&name

output file should be:
first name
l name


Thanks.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Mar 23, 2009 11:42 pm
Reply with quote

Is this a one-for-one replacement?
Only an "&" for a single blank?
Or are there other symbols you need replaced?
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 Mar 24, 2009 1:20 am
Reply with quote

sudarsanreddyk,

You can use DFSORT's FINDREP function to do that kind of thing. For the example you gave, you would use a DFSORT job like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
first&name
l&name
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC FINDREP=(IN=C'&',OUT=C' ')
/*


For complete details on DFFSORT's FINDREP function and the other functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
sudarsanreddyk

New User


Joined: 20 Mar 2006
Posts: 2
Location: hyderabad

PostPosted: Tue Mar 24, 2009 2:12 pm
Reply with quote

Thanks a lot, this solved my problem. very helpful code and the reference link. icon_smile.gif
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 Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top