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

repalce leading zeroes with a character


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Jan 25, 2008 10:46 pm
Reply with quote

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
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Jan 25, 2008 11:38 pm
Reply with quote

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
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Jan 25, 2008 11:40 pm
Reply with quote

The above OUTPUT from step 1 is this:
Code:

10000000
A2222222
 A333333
  A44444
   A5555
    A666
     A77
      A8
      A0
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: Fri Jan 25, 2008 11:59 pm
Reply with quote

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
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Sat Jan 26, 2008 12:15 am
Reply with quote

Thanks!!
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 Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts String has hex character need to conv... COBOL Programming 3
Search our Forums:

Back to Top