View previous topic :: View next topic
|
Author |
Message |
vampire
New User
Joined: 12 Oct 2009 Posts: 15 Location: Pune
|
|
|
|
Hi ,
Is there any way in which we can count the number of records in more than one files and then put those counts in one output file? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show an example of what you want the output file to look like.
Also, give the RECFM and LRECL of the input files. |
|
Back to top |
|
|
vampire
New User
Joined: 12 Oct 2009 Posts: 15 Location: Pune
|
|
|
|
I/P File1:
rec1
rec2
rec3
rec4
I/P File2:
rec1
rec2
O/P File:
Record count file1:4
Record count file2:2
RECFM is FB and LRECL is 25004. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this is one way of achieving what you are after
Code: |
//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN01 DD DSN=INPUT-FILE1,DISP=SHR
//IN02 DD DSN=INPUT-FILE2,DISP=SHR
//COUNT DD DSN=OUTPUT-FILE,DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(10,5),RLSE)
//TOOLIN DD *
COPY FROM(IN01) USING(CTL1)
COPY FROM(IN02) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=COUNT,
REMOVECC,NODETAIL,
TRAILER1=('RECORD COUNT FILE 1:',
COUNT)
/*
//CTL2CNTL DD *
OUTFIL FNAMES=COUNT,
REMOVECC,NODETAIL,
TRAILER1=('RECORD COUNT FILE 2:',
COUNT)
/*
|
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's another way to do it with DFSORT's ICETOOL:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN01 DD DSN=... input file1
//IN02 DD DSN=... input file2
...
//OUT DD DISP=MOD,DSN=... MOD output file
//TOOLIN DD *
COUNT FROM(IN01) WRITE(OUT) EDCOUNT(U08) -
TEXT('Record count file1: ')
COUNT FROM(IN02) WRITE(OUT) EDCOUNT(U08) -
TEXT('Record count file2: ')
...
/*
|
|
|
Back to top |
|
|
|