Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
substring replacement in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: substring replacement in a record
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: 2150
Location: At my coffee table

PostPosted: Mon Mar 23, 2009 11:42 pm    Post subject:
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 Moderator


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

PostPosted: Tue Mar 24, 2009 1:20 am    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us