MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
chikdu Beginner Joined: 06 Jul 2005 Posts: 29 Topics: 20
Posted: Wed Jul 06, 2005 8:06 am Post subject: Sort - Record count for specific criteria
Hi,
I have an input file FILE01
FILE01 has the following layout.
Code:
Account number old system new system
00134335434 05 05
00134567676 05 07
00135554690 07 05
00138456548 05 07
00138543954 05 07
00138543964 05 07
00138543979 03 07
00138543980 06 07
I want the total count of those records for which
1. old system is 05 and new system is 05 AND
2. old system is 05 and new system is 07 AND
3. old system is 07 and new system is 05
That is,the total count in this example is 6.
Can this be done using sort?Can anyone help me on this?
Thanks.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Jul 06, 2005 8:19 am Post subject:
chikdu,
The following JCL will give you the desired results.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00134335434 05 05
00134567676 05 07
00135554690 07 05
00138456548 05 07
00138543954 05 07
00138543964 05 07
00138543979 03 07
00138543980 06 07
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=((13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'05'),OR,
(13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'07'),OR,
(13,2,CH,EQ,C'07',AND,16,2,CH,EQ,C'05'))
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('TOTAL NO: OF RECORDS : ',COUNT)
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
chikdu Beginner Joined: 06 Jul 2005 Posts: 29 Topics: 20
Posted: Fri Jul 15, 2005 5:14 am Post subject:
Hi Kolusu,
Thankyou for your help.
I tried the following sort JCL. But i got the following error message. It seems the DFSORT is of older version.
Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 15:26
INCLUDE COND=((13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'05'),OR,
(13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'07'),OR,
(13,2,CH,EQ,C'07',AND,16,2,CH,EQ,C'05'))
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
$
ICE213A 0 INVALID OUTFIL STATEMENT OPERAND
TRAILER1=('TOTAL NO: OF RECORDS : ',COUNT)
$
Is there any way to know which version of DFSORT i am using and which is the DFSORT version that should be used to execute the following statement?
Can this be done using syncsort?
Pls, let me know.
Thanks.
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Jul 15, 2005 11:05 am Post subject:
The DFSORT error message for REMOVECC indicates that you do not have DFSORT R14 PTF PTF UQ99331 installed. This PTF has been available since March, 2002! Ask your System Programmer to install DFSORT R14 PTF UQ95213 (Dec, 2004) - this will bring you up-to-date on DFSORT enhancements.
Alternatively, you can do this with DFSORT in two steps as follows:
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00134335434 05 05
00134567676 05 07
00135554690 07 05
00138456548 05 07
00138543954 05 07
00138543964 05 07
00138543979 03 07
00138543980 06 07
//SORTOUT DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN DD *
INCLUDE COND=((13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'05'),OR,
(13,2,CH,EQ,C'05',AND,16,2,CH,EQ,C'07'),OR,
(13,2,CH,EQ,C'07',AND,16,2,CH,EQ,C'05'))
SORT FIELDS=COPY
OUTFIL NODETAIL,
TRAILER1=('TOTAL NO: OF RECORDS : ',COUNT)
/*
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=*,RECFM=FB
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(2,79,X)
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum