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

PARSE with Padding Leading SPACES by ZEROES


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

New User


Joined: 24 Jul 2007
Posts: 55
Location: noida

PostPosted: Fri Mar 23, 2012 4:03 pm
Reply with quote

Hi,

I have an VB file (lrecl=340) with # as delimiter. 2nd field (after first #) is Filename field and 4th field (appearing after 3rd #) is a record count field.

Example input file

1201 #TTJZ.CV.TRANS10.MOSTUSED.TEXT #MOSTUSED #8090587 #2
1201 #TTJZ.CV.TRANS10.CAM.TEXT #CAM #6940 #24
1201 #TTJZ.CV.TRANS10.CAUSTIC.TEXT #CAUSTIC #5745 #9
1201 #TTJZ.CV.TRANS10.CLOSR.TEXT #CLOSR #166950 #6
1201 #TTJZ.CV.TRANS10.EVENTA.TEXT #EVENTA #14715085 #15

using Parse i have captured the 2nd (after first #) field and 4th field (after 3rd #). Also I have Right aligned the RECORD COUNT field (after 3rd #) (max length 15 bytes) using below approach

OUTFIL FNAMES=TEMP1,
PARSE=(%00=(ABSPOS=5,ENDBEFR=C'#',FIXLEN=05),
%01=(ENDBEFR=C'#',FIXLEN=45),
%02=(ENDBEFR=C'#',FIXLEN=10),
%03=(ENDBEFR=C'#',FIXLEN=15),
%04=(ENDBEFR=C'#',FIXLEN=08)),
BUILD=(1:%01,47:%03,JFY=(SHIFT=RIGHT),62:19X),CONVERT

I want RIGHT Justified RECORD COUNT field data (Starting from position 47th in Output file) to be padded with leading Zeroes (max length of field is 15 )

Please help. Thanks


Puneet
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 23, 2012 9:24 pm
Reply with quote

puneetvirmani143,


Are you using Syncsort at your shop? If so you should be posting your questions in the JCL forum. Please make it clear. For this question use the following DFSORT JCL


Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD DSN=Your input vb file,DISP=SHR
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                               
  SORT FIELDS=COPY                           
  INREC PARSE=(%01=(ENDBEFR=C'#',FIXLEN=5),   
               %=(ENDBEFR=C'#'),             
               %=(ENDBEFR=C'#'),             
               %02=(ENDBEFR=C'#',FIXLEN=15)),
  BUILD=(1,4,%01,51:%02,UFF,M11,LENGTH=15)   
  OUTFIL FTOV                                 
//*
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 PARSE Syntax for not fix length word ... JCL & VSAM 7
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 Cobol program with sequence number ra... COBOL Programming 5
Search our Forums:

Back to Top