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
 

 

PARSE with Padding Leading SPACES by ZEROES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: PARSE with Padding Leading SPACES by ZEROES
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    Post subject: Reply to: PARSE with Padding Leading SPACES by ZEROES
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    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 Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm


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