Page 1 of 1

SPlit with sort or icetool

PostPosted: Fri Feb 10, 2012 8:11 pm
by vamsyk9
I have data as below in ps file

DSN=XXX.NAME,VOLS=322220,323446,
DSN=XXX.NAME1,VOLS=378756,TOTALBLOCKS=374
ETC..
I want to create out put as below , I am not getting logic to show the output as below into PS file

//GO.STEP DD DSN=XXX.NAME,DISP=SHR,
// DCB=BUFNO=AA,UNIT=DASD0,
// VOL=SER=(322220,323446)

Can this be possible to do with sort or icetool...

Re: SPlit

PostPosted: Fri Feb 10, 2012 11:34 pm
by Frank Yaeger
Your description of what you want to do is extremely unclear!

I really have no idea what you're trying to do so all I can do is throw out a few guesses.
If you want help, you need to explain clearly what you want to do.

You used "SPLIT" as your Subject, but I don't see anything about splitting files in your description.

You mention two existing files and an output file, but you haven't made it clear what you want to do with those files.

DSN=XXX.NAME,VOLS=322220,323446,
DSN=XXX.NAME1,VOLS=378756,TOTALBLOCKS=374


Do you want to create DD statements from the records in an input data set that has their dsnames and attributes?

Do you just want to concatenate/copy XXX.NAME and XXX.NAME1 to XXX.NAME?

Please explain clearly and in detail what you want to do.

Re: SPlit with sort or icetool

PostPosted: Mon Feb 13, 2012 2:31 pm
by vamsyk9
Hi,

I want to break the the string DSN=XXX.NAME1,VOLS=378756,TOTALBLOCKS=374 into DSN= XXX.NAME1, VOLS=378756 Dont want TOTALBLOCKS at all..

Re: SPlit with sort or icetool

PostPosted: Mon Feb 13, 2012 3:07 pm
by BillyBoyo
You can try the following. Are DSN= and VOLS= the only pssibilities for these values (so not DSNAME for instance)?

//DSNVOLS  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
                                                             
  OPTION COPY
                                                             
  INREC PARSE=(%1=(STARTAT=C'DSN=',ENDBEFR=C',',FIXLEN=48),
               %2=(STARTAT=C'VOLS',ENDBEFR=C',',FIXLEN=10)),
               BUILD=(%1,X,%2)
//SORTIN DD *
DSN=XXX.NAME1,VOLS=378756,TOTALBLOCKS=374


Output:
DSN=XXX.NAME1                                    VOLS=378756

Re: SPlit with sort or icetool

PostPosted: Mon Feb 13, 2012 3:23 pm
by vamsyk9
Thanks a lot... It worked fine....

Re: SPlit with sort or icetool

PostPosted: Mon Feb 13, 2012 3:34 pm
by BillyBoyo
OK, thanks for letting us know.

You're not answering any of our questions :-) If you are happy with this as a starting-point, then fine. It won't work where there are multipls numbers after VOLS, for instance. If you get stuck, you can always come back, but we'd need to know the full requirement, with input and output samples, at one shot if possible. Good luck.