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
 

 

Replacing one char with another

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
new2cobol

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Mon Jan 19, 2009 4:08 pm    Post subject: Replacing one char with another
Reply with quote

Few years ago, I found this method using DFSORT to replace one charecter with another in the Sort Tricks pdf file in the IBM website. The current document does not have the same. I am looking for the syntax, all I could remember is (<value to be replaced in hex>, <new value in hex>). This is not for any business requirement, just curious.

Can some one help?
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Jan 19, 2009 4:32 pm    Post subject:
Reply with quote

Hello There,

You can use ALTSEQ for this
Suppose if you want to replace all x'5c' to space. You cna use following sort card
Code:

  OPTION COPY                     
  ALTSEQ CODE=(5C40)
  OUTREC FIELDS=(1,80,TRAN=ALTSEQ)


Here i am assuming that input record length is 80
Back to top
View user's profile Send private message
new2cobol

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Mon Jan 19, 2009 4:47 pm    Post subject:
Reply with quote

Thanks, that was exactly what I was looking for!
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Jan 19, 2009 5:29 pm    Post subject: Reply to: Replacing one char with another
Reply with quote

Hi,

There is another function included in DFSORT now:

Code:

  INREC FINDREP=(IN=C'Goodbye',OUT=C'Bye')


This can help you writing a string in chars without any hex values.

Thanks,
-Kapil.
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: Mon Jan 19, 2009 10:15 pm    Post subject:
Reply with quote

Quote:
Few years ago, I found this method using DFSORT to replace one charecter with another in the Sort Tricks pdf file in the IBM website. The current document does not have the same.


Yes, it does. The "Change all zeros in your records to spaces" Smart DFSORT Trick shows you how to do that kind of thing with DFSORT's new FINDREP function available with z/OS DFSORT PTF UK90013 (July, 2008). The "Replace or remove strings anywhere in a file" Smart DFSORT Trick shows you how to use FINDREP for more situations. FINDREP is more flexible and powerful than TRAN=ALTSEQ.

For complete details on DFSORT's new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

If you don't have PTF UK90013, ask your System Programmer to install it (it's free).
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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Replacing Start Transid with LINK pkmurali CICS 12 Tue Apr 19, 2016 8:22 pm
No new posts conversion from char to packed decimal Musab Ahmed DFSORT/ICETOOL 7 Fri Apr 08, 2016 1:12 pm
No new posts Converting field from char to number danylele74 DB2 4 Tue Mar 29, 2016 4:24 pm


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