MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
gharidoss Beginner Joined: 14 Mar 2005 Posts: 38 Topics: 15 Location: Bangalore
Posted: Thu Jul 20, 2006 6:07 am Post subject: Get the input and output records count in report file
Hi All,
I need to find the records count of input and output files and create the report file. It should be single line, it contains input and output records count.
Input File
100 records
By using include condition, I got 3 records as output.
Report File
Input: 100 Output: 3
I tried I'm getting seperate lines.
Code:
//IN1 DD DISP=SHR,DSN=INPUT FILE NAME
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//T3 DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT DD DSN=OUTPUT FILE NAME,
//RPT DD DSN=REPORT FILE NAME
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CNT1)
COPY FROM(IN1) TO(OUT) USING(CNT2)
COPY FROM(OUT) TO(T2) USING(CNT3)
COPY FROM(T3) TO(RPT)
/*
//CNT1CNTL DD *
OUTFIL FNAMES=T1,NODETAIL,REMOVECC,
TRAILER1=(1:'IN :',2X,COUNT=(M11,LENGTH=5))
/*
//CNT2CNTL DD *
SORT FIELDS=(1,18,CH,A)
INCLUDE COND=(21,6,CH,EQ,C'SUI ')
OUTFIL FNAMES=OUT
/*
//CNT3CNTL DD *
OUTFIL FNAMES=T2,NODETAIL,REMOVECC,
TRAILER1=(40:'OUT :',2X,COUNT=(M11,LENGTH=5))
/*
It's possible to get it in the single line
Thanks,
Hari
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Thu Jul 20, 2006 8:27 am Post subject:
gharidoss ,
If your intention is to just find the counts of input and output then you can do it in a single step
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(01:21,06,CHANGE=(1,C'SUI ',C'1'),
NOMATCH=(C'0'),
80:X)
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('INPUT COUNT: ',COUNT,3X,
'OUTPUT COUNT: ',
TOT=(1,1,ZD,M10,LENGTH=8))
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
gharidoss Beginner Joined: 14 Mar 2005 Posts: 38 Topics: 15 Location: Bangalore
Posted: Thu Jul 20, 2006 10:15 pm Post subject:
Hi Kolusu,
Sorry for the later reply, I tested it's working fine, Thanks a lot...
Thanks,
Hari
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Jul 26, 2006 4:09 pm Post subject:
Here's another way to do it with DFSORT:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(1:C'00000000')),
IFTHEN=(WHEN=(21,6,CH,EQ,C'SUI'),
OVERLAY=(1:C'00000001'))
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('INPUT COUNT: ',COUNT,3X,
'OUTPUT COUNT: ',
TOT=(1,8,ZD,M10,LENGTH=8))
/*
_________________ 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