IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

finding no of records in multiple files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Wed Jul 22, 2015 12:59 pm
Reply with quote

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
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Wed Jul 22, 2015 1:53 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Wed Jul 22, 2015 2:42 pm
Reply with quote

Why don't you just use ICETOOL's COUNT operator?
Back to top
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Fri Jul 24, 2015 12:12 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Fri Jul 24, 2015 12:40 pm
Reply with quote

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
View user's profile Send private message
vickey_dw

New User


Joined: 10 Jun 2015
Posts: 51
Location: India

PostPosted: Fri Jul 24, 2015 2:20 pm
Reply with quote

got your point bill thanks for detailed explaination icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Writng matched records into output fi... DFSORT/ICETOOL 5
No new posts Merging more than two records DFSORT/ICETOOL 15
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts REMOVE DUPLICATE RECORDS BASED ON A S... DFSORT/ICETOOL 4
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
Search our Forums:

Back to Top