View previous topic :: :: View next topic
|
Author |
Message |
yianis
New User
Joined: 14 Aug 2006 Posts: 45
|
|
|
|
How do you replace leading zeroes with a character
Input
00000123
Output
AAAAA123
I looked at the EDIT MASKS and I don't think you can do it with TRAN=xxx etc..
Is there a EDIT parameter to do this ? |
|
Back to top |
|
 |
|
|
yianis
New User
Joined: 14 Aug 2006 Posts: 45
|
|
|
|
I have managed to do this in a 2-step process, but wondering if this can be done in a single step using a mask.
STEP1:
=====
Code: |
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,8,ZD,EDIT=(SIIIIIIIT),SIGNS=(A,),LENGTH=8)
//*
|
Input:
Code: |
10000000
02222222
00333333
00044444
00005555
00000666
00000077
00000008
00000000
|
OUTPUT:
Code: |
10000000
A2222222
A333333
A44444
A5555
A666
A77
A8
A0
|
STEP2:
=====
Code: |
//SYSIN DD *
OPTION COPY
ALTSEQ CODE=(40C1) * CHANGE F0='0' TO C1='A'
OUTREC BUILD=(1,8,TRAN=ALTSEQ)
|
Input is the output from above
OUTPUT
Code: |
10000000
A2222222
AA333333
AAA44444
AAAA5555
AAAAA666
AAAAAA77
AAAAAAA8
AAAAAAA0
|
|
|
Back to top |
|
 |
yianis
New User
Joined: 14 Aug 2006 Posts: 45
|
|
|
|
The above OUTPUT from step 1 is this:
Code: |
10000000
A2222222
A333333
A44444
A5555
A666
A77
A8
A0
|
|
|
Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA
|
|
|
|
You can use these DFSORT control statements:
Code: |
OPTION COPY
ALTSEQ CODE=(40C1)
INREC IFTHEN=(WHEN=INIT,OVERLAY=(1:1,8,ZD,TO=FS,LENGTH=8,
1:1,8,TRAN=ALTSEQ))
|
|
|
Back to top |
|
 |
yianis
New User
Joined: 14 Aug 2006 Posts: 45
|
|
|
|
Thanks!! |
|
Back to top |
|
 |
|