replace sapce by 0



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

replace sapce by 0

Postby samb01 » Wed Jun 03, 2015 6:57 pm

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.
samb01
 
Posts: 236
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: replace sapce by 0

 

Re: replace sapce by 0

Postby enrico-sorichetti » Wed Jun 03, 2015 7:26 pm

try something like
FINDREP=(INOUT=(X'40',X'F0'),STARTPOS=....,ENDPOS=....)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: replace sapce by 0

Postby BillyBoyo » Wed Jun 03, 2015 8:45 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: replace sapce by 0

Postby samb01 » Thu Jun 04, 2015 2:51 pm

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)
//*                                                         

samb01
 
Posts: 236
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: replace sapce by 0

Postby BillyBoyo » Thu Jun 04, 2015 3:21 pm

Thanks for the example. Of course SKIPREC is good. There is even a second shot with OUTFIL if required.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post