Adding leading Zero to output value



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Adding leading Zero to output value

Postby Frank Yaeger » Wed Mar 02, 2011 11:32 pm

Why are you overcomplicating this? If you want to add a '0' before the second column, just use these control statements:

  SORT FIELDS=COPY
  INREC PARSE=(%00=(ENDBEFR=X'6A',FIXLEN=02),
              %01=(ENDBEFR=X'6A',FIXLEN=04),     <------- use 4 instead of 5
              %02=(ENDBEFR=X'6A',FIXLEN=04),
              %03=(ENDBEFR=X'6A',FIXLEN=15),
              %04=(ENDBEFR=X'6A',FIXLEN=02)),
  BUILD=(%00,C'0',%01,%02,%03,%04)                <----- insert '0'
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Re: Adding leading Zero to output value

 

Re: Adding leading Zero to output value

Postby rjambu » Thu Mar 03, 2011 12:01 am

Thanks Frank,
Works fine O/p are as expected .
rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post