lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Hi ppl,
I've the following jcl
It will group records with its sum based on the condition given.
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NAME1 SECOND
NAME1 FIRST
NAME1 THIRD
NAME1 FOURTH
NAME2 THIRD
NAME2 SECOND
NAME2 FIRST
NAME2 FOURTH
NAME2 FIFTH
NAME4 FIRST
NAME3 FIRST
NAME3 SECOND
NAME3 THIRD
NAME5 FIRST
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(25:C'1'))
SORT FIELDS=(3,5,CH,A)
SUM FIELDS=(25,1,ZD)
INCLUDE COND=(3,5,CH,EQ,C'NAME1',OR,3,5,CH,EQ,C'NAME2',OR,
3,5,CH,EQ,C'NAME3')
OUTREC BUILD=(5:1,25)
/*
|
The output is getting displayed as
Code: |
NAME1 SECOND 4
NAME2 THIRD 5
NAME3 FIRST 3
|
I need to display records only with the count greater than or equal to 4.
How do i eliminate the other records??
Can we have conditions in INREC and OUTREC? |
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Yes you can have conditions in INREC and OUTREC. In this case you can try using OUTREC IFTHEN=(WHEN=(25,1,ZD,GE,4) |
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Ya.. I gave the following statements to achieve the result.
Code: |
OUTFIL FNAMES=OUT1,OMIT=(300,1,ZD,LE,3)
OUTREC FIELDS=(1:1,300)
|
Thanks... |
|