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

Replacing caharacters using utilities


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manugeorge2004

New User


Joined: 17 Jun 2009
Posts: 38
Location: Denver

PostPosted: Thu Jul 12, 2012 3:09 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 12, 2012 3:52 am
Reply with quote

Have a look at FINDREP (Find and Replace) in your documentation for your Sort product.
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Thu Jul 12, 2012 7:46 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jul 13, 2012 9:02 am
Reply with quote

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
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Fri Jul 13, 2012 12:04 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Finding record and replacing with val... DFSORT/ICETOOL 3
No new posts Replacing character string in file th... JCL & VSAM 9
No new posts Replacing PDSMAN with PDSFAST JCL & VSAM 10
No new posts Installing sort utilities on hercules... DFSORT/ICETOOL 4
Search our Forums:

Back to Top