View previous topic :: View next topic
|
Author |
Message |
renjithravi1 Warnings : 2 New User
Joined: 31 May 2005 Posts: 16
|
|
|
|
Hi,
I have a requirement to count the number of records in the input file and write to an output file.
The requirement is like i have 10 input datasets and the number of records in each dataset should be written as separate record in a single output file.
Kindly help me in this case!
Thanks and regards
Renjith |
|
Back to top |
|
|
renjithravi1 Warnings : 2 New User
Joined: 31 May 2005 Posts: 16
|
|
|
|
Hi,
I have already tried for one dataset by using the following code,
Code: |
//S020 EXEC PGM=ICETOOL,
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD
//OUT DD
//TOOLIN DD *
COUNT FROM(IN) WRITE(OUT)
/*
|
But getting the error
Code: |
COUNT FROM(IN) WRITE(OUT)
$
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER
|
|
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
ICETOOL's COUNT will write the count to TOOLMSG.
What you could do is set TOOLMSG to a dataset and then select the lines with the information you need and format output records from those.
Garry. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Or even something like this.
Code: |
//OUT DD DSN=Output file,DISP=MOD
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL1)
......
......
//CTL1CNTL DD *
OPTION COPY
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,TRAILER1=(COUNT) |
|
|
Back to top |
|
|
renjithravi1 Warnings : 2 New User
Joined: 31 May 2005 Posts: 16
|
|
|
|
Hi,
Thanks you very much for the answer. I have tried and it has been working. But i have one more requirement of print a certain text also with the number of records like,
FILE100010
FILE200012
Is is possible in ICETOOL?
Thanks and regards
Renjith |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The error message for:
Code: |
COUNT FROM(IN) WRITE(OUT)
|
indicates that you don't have z/OS DFSORT V1R5 PTF UK90013 (July, 2008) installed. You need that PTF to use the WRITE function. Ask your System Programmer to install the PTF (it's free).
Once you have that PTF installed, you can do what you want using a DFSORT/ICETOOL job like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file1
...
//IN10 DD DSN=... input file10
//CT1 DD DSN=... output file1
//CT2 DD DSN=... output file2
...
//CT10 DD DSN=... output file10
//TOOLIN DD *
COUNT FROM(IN1) TEXT('FILE1') WRITE(CT1) DIGITS(5)
COUNT FROM(IN2) TEXT('FILE2') WRITE(CT2) DIGITS(5)
...
COUNT FROM(IN10) TEXT('FILE10') WRITE(CT10) DIGITS(5)
/*
|
Alternatively, you could do it with this DFSORT/ICETOOL job that doesn't require the PTF:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file1
...
//IN10 DD DSN=... input file10
//CT1 DD DSN=... output file1
//CT2 DD DSN=... output file2
...
//CT10 DD DSN=... output file10
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
...
COPY FROM(IN10) USING(CTLA)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=CT1,REMOVECC,NODETAIL,
TRAILER1=('FILE1',COUNT=(EDIT=(TTTTT)))
/*
//CTL2CNTL DD *
OUTFIL FNAMES=CT2,REMOVECC,NODETAIL,
TRAILER1=('FILE2',COUNT=(EDIT=(TTTTT)))
/*
...
//CTLACNTL DD *
OUTFIL FNAMES=CT10,REMOVECC,NODETAIL,
TRAILER1=('FILE10',COUNT=(EDIT=(TTTTT)))
/*
|
|
|
Back to top |
|
|
|