Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

repalce leading zeroes with a character

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: repalce leading zeroes with a character
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    Post subject: Reply to: repalce leading zeroes with a character
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 25, 2008 11:59 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us