replace sapce by 0
Posted:
Wed Jun 03, 2015 6:57 pm
by samb01
Heelo i have a dataset
BANDONM CHAM
XXXXX AAAAA 12548593
XXXXX AAAAA 548593
XXXXX AAAAA 12548593
XXXXX AAAAA 2548593
and i would like to get this
12548593
00548593
12548593
02548593
skipping the first line et the number which are in 8 characters moving in column 1 by changing the space by 0 to get a number in 8 charaters in the outfile.
thank's for your help.
Re: replace sapce by 0
Posted:
Wed Jun 03, 2015 8:45 pm
by BillyBoyo
If the data on the first record is "regular" enough (like a single value, or a range of values, or a position which on the data-record is always blank, but on the first record can never be blank, then you can use INCLUDE COND= or OMIT COND= to get rid of it. Else you have to append a sequence number long enough to hold the count of all your records, and use OUFIL INCLUDE=/OMIT= to get rid of records with a sequence of 1, and a BUILD to get ride of the appended data.
To get your number, just BUILD=(13,8,FS,EDIT=(TTTTTTTT)) should do you.
Re: replace sapce by 0
Posted:
Thu Jun 04, 2015 2:51 pm
by samb01
Thank's BillyBoyo for your help.
Here is my jcl for the real file whose dcb is LRECL : 300 and FB and the numbers are in the positions 63.
//FORMAT EXEC PGM=SORT,REGION=4096K
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=FVBC.FVCGD.HVGTR
//SORTOUT DD DISP=SHR,DSN=FVBC.FVCGD.HVGTR.SORT
//SYSIN DD *
SORT FIELDS=COPY,SKIPREC=1
OUTFIL FNAMES=SORTOUT,BUILD=(63,8,FS,EDIT=(TTTTTTTT),300:X)
//*
Re: replace sapce by 0
Posted:
Thu Jun 04, 2015 3:21 pm
by BillyBoyo
Thanks for the example. Of course SKIPREC is good. There is even a second shot with OUTFIL if required.