Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

replace matching characters with another character using sor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Wed Apr 17, 2013 12:59 pm    Post subject: replace matching characters with another character using sor
Reply with quote

hi ,

can you please suggest me on how to replace particular character with new character, using sort

example :-

I need to replace 'where' with 'xxxxx'

------
input :-

where do you stay and where is are you from

output :-

xxxxx do you stay and xxxxx is are you from

--------
note :here 'where' can be present in any position
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 17, 2013 1:16 pm    Post subject:
Reply with quote

Search the forum, lots of examples.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 17, 2013 1:48 pm    Post subject:
Reply with quote

What is the Sort product you are using?

Also please check if your sortproduct supports FINDREP or something similar
Back to top
View user's profile Send private message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Wed Apr 17, 2013 1:54 pm    Post subject: Reply to: replace matching characters with another character
Reply with quote

thank you ,, my problem solved using findrep
Back to top
View user's profile Send private message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Wed Apr 17, 2013 2:24 pm    Post subject: Reply to: replace matching characters with another character
Reply with quote

adding to previous querry,

here I got logic to replace one character with another.

how to replace these characters based on an indicator Present at position 1.

ex :

input:

2 where are you from and where do you stay
1 where are you from and where do you stay
2 where are you from and where do you stay

out put:

2 xxxxx are you from and xxxxx do you stay
1 yyyyy are you from and yyyyyy do you stay
2 xxxxx are you from and xxxxx do you stay

note :if 1 in first position then 'where' changed to
'yyyyy'

if 2 in first position then 'where' replaced with 'xxxxx'

thank you,
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 17, 2013 2:33 pm    Post subject:
Reply with quote

Probably you need to use INREC IFTHEN with FINDREP as a combo icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Apr 17, 2013 2:33 pm    Post subject: Reply to: replace matching characters with another character
Reply with quote

Use IFTHEN=(WHEN=(logical expression to identify the case, the FINDREP subordinate to that. Again, many examples.
Back to top
View user's profile Send private message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Wed Apr 17, 2013 2:40 pm    Post subject: Reply to: replace matching characters with another character
Reply with quote

thank you, provided way worked well
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us