Page 1 of 1

Selective processing in JCL.

Posted: Tue Jul 28, 2015 2:21 pm
by Chandra Anad
Hi All,

i had a query related to using JCL for following :

have a input file with following values :

Code: Select all

1
1
1
1
2
1
1
1
2
1
2
1
1
2
1
now the expected output is only those records with 1 and 2 in succession, and ignore the '1' records that dont have 2 in the subsequent record.. (here in this sample : the record # 4,5,8,9,10,11,13,14 are expected in the output)

output :

Code: Select all

1
2
1
2
1
2
1
2
can anyone suggest of ways to do this using JCL ?

Thanks,

Re: Selective processing in JCL.

Posted: Tue Jul 28, 2015 3:12 pm
by nicc
By JCL do you mean DFSORT? JCL is not DFSORT - it is an entirely different product designed to let the OS know what resources your task/job requires.

Re: Selective processing in JCL.

Posted: Tue Jul 28, 2015 3:41 pm
by Chandra Anad
I have tried this:

Code: Select all

//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,1,CH,EQ,C'1'),
END=(6,1,CH,EQ,C'2'),
PUSH=(8200:ID=6))
OUTFIL FNAMES=SORTOUT
/*
group ID
1 1
1 2
1 3
1 4
2 4
1 5
1 6
2 6
Now, all i did was extract only those records with duplicate group ID's using ICETOOL ALLDUPS (here group id 4 and 6 ).