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

Replacing one char with another


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Mon Jan 19, 2009 4:32 pm
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
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
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 Developer


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

PostPosted: Mon Jan 19, 2009 10:15 pm
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:

Use [URL] BBCode for External Links

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top