View previous topic :: View next topic
|
Author |
Message |
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
Thanks, that was exactly what I was looking for! |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|