View previous topic :: View next topic
|
Author |
Message |
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
I am having record like this.
abcdefgh12345ijkl
asdfghjk12345jklk
vnjklkdd00000jkjk
when ever i find 12345 on position 9, i have to replace with 67890. but I am not allowed to use IFTHEN. I tried it in some other ways. output is coming but in too many steps. (filtered the records having 12345, then used OUTREC and finally merged).
Is there any simple way to handle this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please explain the IFTHEN restriction |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Dick,
According to our coding standards, we shouldn't use that. That's all. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Try using DFSORT's CHANGE function. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Use the following sort card
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFGH12345IJKL
ASDFGHJK12345JKLK
VNJKLKDD00000JKJK
/*
//SORTOUT DD DSN= output file...
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(9:9,5,CHANGE=(5,C'12345',C'67890'),
NOMATCH=(9,5))
/*
|
Output:
Code: |
ABCDEFGH67890IJKL
ASDFGHJK67890JKLK
VNJKLKDD00000JKJK
|
|
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Thanks AARU. CHANGE solved the problem |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
You are welcome |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
According to our coding standards, we shouldn't use that. That's all.
|
Strange standard. Are you allowed to use OVERLAY? Given that OVERLAY and IFTHEN have both been available with DFSORT since Dec, 2004, that would make the standard even stranger. Perhaps it's time to question the standards? Your site is paying for all of these functions in DFSORT, so why not take advantage of them?
CHANGE works ok for this particular situation, but there are many situations where IFTHEN is required. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
More then likely the standard is for JCL, while you and I know that sort control cards are not JCL a lot of people don't. |
|
Back to top |
|
|
|