View previous topic :: View next topic
|
Author |
Message |
manugeorge2004
New User
Joined: 17 Jun 2009 Posts: 38 Location: Denver
|
|
|
|
Hi
I have a requirement where I need to replace a set of characters to another set of characters using some utility. The characters can appear in any position in the record.
For eg. LRECL is 80 bytes. I need to check for 'ABCD' anywhere in the record and replace it with 'ZZZZ'. A COBOL INSPECT statement can do this. But I wanted to check whether any utility like SORT or SYNCTOOL can do this.
Thanks and Regards
Manu |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have a look at FINDREP (Find and Replace) in your documentation for your Sort product. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Please try below option
Code: |
//SORTIN DD *
SSSSSABCDSSSSSSSABCDSSSSSSSSSS
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FINDREP=(IN=C'ABCD',OUT=C'ZZZZ')
/*
|
Out Put -
Code: |
SSSSSZZZZSSSSSSSZZZZSSSSSSSSSS
|
Thanks,
Sandip Walsinge
Walsinge Technologies Pvt. Ltd. Pune |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Sandip,
Your control statements seem to start from pos-1 which will result in syntax error if someone tries to execute it. Use "Code" tags to preserve alignment when you post some code. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Arun,
Thanks for the correction. By mistake I typed control statements from 1st position.
Thanks,
Sandip Walsinge
Walsinge Technologies Pvt. Ltd. Pune |
|
Back to top |
|
|
|