View previous topic :: View next topic
|
Author |
Message |
sudarsanreddyk
New User
Joined: 20 Mar 2006 Posts: 2 Location: hyderabad
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Is this a one-for-one replacement?
Only an "&" for a single blank?
Or are there other symbols you need replaced? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sudarsanreddyk
New User
Joined: 20 Mar 2006 Posts: 2 Location: hyderabad
|
|
|
|
Thanks a lot, this solved my problem. very helpful code and the reference link. |
|
Back to top |
|
|
|