Page 1 of 1

need to convert the following code to syncsort

PostPosted: Mon Jul 28, 2008 1:57 pm
by ycflotildes
Hi,

Just found the below code from smart DFSORT Tricks manual. However, I cannot execute it since I am using syncsort. Can anyone convert the following code to use syncsort? Thanks!

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/n)
//SORTOUT DD DSN=... output file (FB/8)
//SYSIN DD *
OPTION COPY
INREC PARSE=(%=(ENDAT=C'COPY'),
%00=(STARTAFT=BLANKS,FIXLEN=8)),
BUILD=(%00)
//

Re: need to convert the following code to syncsort

PostPosted: Mon Jul 28, 2008 10:11 pm
by dick scherrer
Hello,

Which release of Syncsort is used on your system?

If you are not sure, run any Syncsort step and post the release info from the printed output.

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 7:21 am
by ycflotildes
Hi,

Is this what you're asking for?

SYNCSORT FOR Z/OS 1.2.2.2R

Thanks!

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 7:53 am
by dick scherrer
Hello,

Yes, that is what i was looking for. . . Your system is not running the most current release of Syncsort (1.3).

PARSE is not supported in the release you are using.

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 8:06 am
by ycflotildes
Are there other ways to do it without using parse?

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 8:37 am
by dick scherrer
Hello,

Please post some sample input and the output you want when that input is processed.

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 8:43 am
by ycflotildes
I ran a search and my search result looks something like this.

ASDF ASDFS COPY SDFSGWER
ASDF COPY SDFSGWSD
ASDF COPY SDFSGWAC
COPY SDFSGWSE
SDFSSDF COPY SDFSGWSD
SDF COPY SDFSGWAR

The copybook names appear in different positions. I want to find each copybook name after 'COPY ' and extract it to the output file so I end up with just the list of copybook names like this:
SDFSGWER
SDFSGWSD
SDFSGWAC
SDFSGWSE
SDFSGWSD
SDFSGWAR

How is this done with syncsort without using the parse function? Thanks!

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 9:04 am
by dick scherrer
Hello,

Maybe someone will post a way to do this with the sort but without parse. . . I'm not aware of a way.

Keep in mind that this is a fairly easy bit of cobol code (not so very long ago, there was no parse function in a sort product, so people wrote the code).

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 9:20 am
by ycflotildes
do you know how can this be written in cobol code? thanks!

Re: need to convert the following code to syncsort

PostPosted: Tue Jul 29, 2008 11:55 am
by dick scherrer
Hello,

Set up a loop using reference modification and parse the data looking for "COPY ".

When "COPY " is found, increment the starting position by 6 (to get past the literal) and enter a second loop to move characters until a blank (or other terminator - say a period) is encountered.