View previous topic :: View next topic
|
Author |
Message |
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
My Input file is delimiter seperated by $.
Sample Input file:
12345$abcd$345$
23456$adcb$456$
but also i have the below record in my input file.
23$56$a$cb$456$
The $ at 3rd position and 8th position should be replaced to ' ' but other $ which are actual delimiters should not be replaced with ' '.
Final output:
12345$abcd$345$
23456$adcb$456$
23 56$a cb$456$
Could someone help me out here? |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
i forgot to add one more thing. The places i mentioned (3rd and 8th position) is not fixed. It can come anywhere in the file. Can this be done in DFSORT? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
You say the position of the $ is not fixed, so how would you differentiate which $ character needed to be replaced and which ones to keep as is? You need to explain the rules for replacing the $ character more clearly |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Kolusu,
Sorry for not mentioning clearly.
The $ sign at 6th position, 11th position and 15th position (actual delimiters) should not be replaced by ' '. If $ is find at any other position, it should be replaced by ' '. |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
And we don't have latest JUL 2008 PTF UK90013 release in my shop (Already requested for the same) |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
senjay,
Since you don't have the latest PTF the following DFSORT JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
12345$ABCD$345$
23456$ADCB$456$
23$56$A$CB$456$
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(6:C'@',11:C'@',15:C'@')
OUTREC BUILD=(1,80,TRAN=ALTSEQ)
ALTSEQ CODE=(5B40)
OUTFIL OVERLAY=(6:C'$',11:C'$',15:C'$')
//*
|
If you have the latest PTF it can be done quite easily with FINDREP parm
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
12345$ABCD$345$
23456$ADCB$456$
23$56$A$CB$456$
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(6:C'@',11:C'@',15:C'@')
OUTREC FINDREP=(INOUT=(C'$',C' ',C'@',C'$'))
//* |
For complete details on the new FINDREP and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Kolusu,
Thanks. But it will not work for me as i don't have the latest PTF. Could you suggest another way?
Quote: |
And we don't have latest JUL 2008 PTF UK90013 release in my shop (Already requested for the same) |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
senjay
*sigh* Did you really read my entire last post? I DID provide you with 2 solutions. |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
I am sorry. I am also trying here with ALTSEQ.
Somehow missed it.
I am really sorry for irritating the person who is probably having the best of patience in the forum.
:-(
I'll have a look in to your solution and get back to you. Thanks a lot. |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Kolusu,
Thanks a lot for your time and solution |
|
Back to top |
|
|
|