Page 1 of 1

Select 3 Record Types

PostPosted: Wed May 08, 2013 11:04 pm
by rayngerfan
I want to check a file for at least 1 occurrence of 3 record types that start in column 1 (000,188 & 999). If the file doesn't contain at least 1 occurrence of these records, the job should receive a RC=4. I was able to achieve this task, but I needed to execute two steps. Is it possible to achieve this in only 1 step?

//STEP1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
000
188
188
188
188
188
188
188
999
//OUT1 DD DSN=&&HEADER,DISP=(,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),UNIT=TEST,DCB=(LRECL=80,RECFM=FB)
//OUT2 DD DSN=&&DATA,DISP=(,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),UNIT=TEST,DCB=(LRECL=80,RECFM=FB)
//OUT3 DD DSN=&&TRAILER,DISP=(,CATLG,DELETE),
// UNIT=TEST,SPACE=(CYL,(1,1),RLSE),DCB=(LRECL=80,RECFM=FB)
//TOOLIN DD *
SORT FROM(IN) TO(OUT1) USING(CTL1)
SORT FROM(IN) TO(OUT2) USING(CTL2)
SORT FROM(IN) TO(OUT3) USING(CTL3)
//CTL1CNTL DD *
SORT FIELDS=COPY,STOPAFT=1
INCLUDE COND=(1,3,CH,EQ,C'000')
//*
//CTL2CNTL DD *
SORT FIELDS=COPY,STOPAFT=1
INCLUDE COND=(1,3,CH,EQ,C'188')
//*
//CTL3CNTL DD *
SORT FIELDS=COPY,STOPAFT=1
INCLUDE COND=(1,3,CH,EQ,C'999')
//*
//STEP2 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=*.STEP1.OUT1,DISP=SHR
// DD DSN=*.STEP1.OUT2,DISP=SHR
// DD DSN=*.STEP1.OUT3,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN) NOTEQUAL(03) RC4
/*

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 2:27 pm
by BillyBoyo
Although you can specify ICETOOL SORT with OPTION COPY/SORT FIELDS=COPY, you can use ICETOOL COPY instead of SORT.

It is possible with one pass of the data using WHEN=GROUP.

Does SyncTool have the SUBSET operator?

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 7:12 pm
by dick scherrer
Hi BB,

Not that i can find in the 1.4 manual.

d

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 7:42 pm
by BillyBoyo
Hi Dick,

Thanks. I think it is one of those things. If it were there, It is "undocumented", so to know if it is there, you have to try it :-)

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 10:43 pm
by rayngerfan
version 1.7.0 does have a SUBSET parameter.

SYT000I SYNCTOOL RELEASE 1.7.0 - COPYRIGHT 2008 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED

SUBSET FROM(IN) TO(OUT) KEEP INPUT LAST(30)

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 11:45 pm
by dick scherrer
Yup, that is Synctool. The current release of Syncsort is 1.4.x.

It would help if they were all the same "release" . . . (methinks) ;)

d

Re: Select 3 Record Types

PostPosted: Thu May 09, 2013 11:49 pm
by dick scherrer
Looks like my bad . . . :oops:

My first reply was based on the Syncsort doc. Interestingly enough, i do not seem to have Synctool info. Once upon a time it was undocumented and rather closely followed ICETOOL conventions.

I'll try to find out more. . .

Sorry for the mis-cue,

d