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

Replace leading zeroes with blanks


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: Tue Sep 26, 2006 9:05 pm
Reply with quote

Hi,

I need to repalce leading zeroes with blanks..I cannot find a EDIT MASK that does this...

Input

Code:
----+----1----+----2----+----3--
********************************
00011000106477301




Column 01 replace leading zeores (lenght 15)

Thanks
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Tue Sep 26, 2006 9:07 pm
Reply with quote

Oh yeah the leading zeroes vary..

Code:
00011000106477301
00011000115214901
00001000116593501
01000166716789901
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Sep 26, 2006 9:12 pm
Reply with quote

Hi yianis,

U can declare another variable
05 WS-MASK-VAR PIC Z(14)9(1).

Move ur variable to WS-MASK-VAR.Display it.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Sep 26, 2006 9:14 pm
Reply with quote

Hi yianis,

I provide the solution for cobol. In case if u want to use it sort I will come back to u.
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Tue Sep 26, 2006 9:24 pm
Reply with quote

Thanks,

I think all I have to do is
OUTREC BUILD=(1,08,
09,16,ZD,EDIT=(IIIIIIIIIIIIIIII),
25,24)

This is my real example... I have a field in position 09 for a length of 16. This field contains spaces in front of it too.

Sample Data:



This seems to work...

Code:
----+----1----+----2----+----3----+----4----+---
00082286       80272373107906002         0014419
00082286     0880272370107906002         0014419
00082286     0880051260107906002         0014427
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: Tue Sep 26, 2006 10:19 pm
Reply with quote

DFSORT's M10 edit mask will do that. For example:

Code:

//S1    EXEC  PGM=ICEMAN                               
//SYSOUT    DD  SYSOUT=*                               
//SORTIN DD *                                           
00011000106477301                                       
00011000115214901                                       
00001000116593501                                       
01000166716789901                                       
//SORTOUT DD SYSOUT=*                                   
//SYSIN    DD    *                                     
  OPTION COPY                                           
  INREC OVERLAY=(1:1,17,ZD,M10,LENGTH=17) 
/*             
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Tue Sep 26, 2006 10:59 pm
Reply with quote

Thanks Frank !
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
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
Search our Forums:

Back to Top