View previous topic :: View next topic
|
Author |
Message |
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
Hello Experts,
I know how to find number of records in single file using
Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('No of records: ',COUNT=(M11,LENGTH=8)) |
But Is there any way i can find no of recods present in multiple files ?
Means i have 5 files and i want to find no of records present in each of them in single output file and in only one step in jcl.
Like if my 1st files has 15000 records,2 file has 17000,3rd -->20000 , 4th-->50000 and 5th -->10000.Then my output should be like below
Code: |
15000
17000
20000
50000
10000 |
Please provide your suggestion on this |
|
Back to top |
|
|
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
guys i got the solution
Sorry for not doing enough research
here is my working code using ICETOOL
Code: |
//TOOLIN DD *
COPY FROM(IN01) TO(OUT) USING(CT01)
COPY FROM(IN02) TO(OUT) USING(CT02)
//CT01CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=5))
//CT02CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=5)) |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why don't you just use ICETOOL's COUNT operator? |
|
Back to top |
|
|
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
Thank you very much bill for suggestion
ICETOOL Count is working much faster than earlier one
Code: |
//TOOLIN DD *
COUNT FROM(IN01) USING(CTL1) WRITE(OUT) DIGITS(8)
COUNT FROM(IN02) USING(CTL2) WRITE(OUT) DIGITS(8)
COUNT FROM(IN03) USING(CTL3) WRITE(OUT) DIGITS(8)
COUNT FROM(IN04) USING(CTL4) WRITE(OUT) DIGITS(8)
COUNT FROM(IN05) USING(CTL5) WRITE(OUT) DIGITS(8)
/*
//CTL1CNTL DD *
INCLUDE COND=ALL
/*
//CTL2CNTL DD *
INCLUDE COND=ALL
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You don't need the USINGs, either. I've never actually seen COND=ALL being used. INCLUDE COND=ALL is identical to having no INCLUDE at all.
The very most efficient way (used to be the standard way) is to always count the records whenever you process a file, and show them at the end. You then don't ever have to count them separately.
Then you match them to trailer counts, match between programs, match across systems, etc. All done "automatically" (by coding it) and ensuring records are lost or duplicated or added in error, etc. |
|
Back to top |
|
|
vickey_dw
New User
Joined: 10 Jun 2015 Posts: 51 Location: India
|
|
|
|
got your point bill thanks for detailed explaination |
|
Back to top |
|
|
|