MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Utility to count records?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
memays
Beginner


Joined: 18 Dec 2008
Posts: 4
Topics: 2

PostPosted: Fri Aug 22, 2014 12:41 pm    Post subject: Utility to count records? Reply with quote

I need to count the number of records in many sequential files. I would ike to setup a job that can read them without having to specify a LRECL for each one. I tried IDCAMS REPRO, and it can read based on the DSN only, could not get it to run without specifying an output DCB. Tried DUMMY, but it failed also.

Is there a utility or easy way to do this?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Fri Aug 22, 2014 1:00 pm    Post subject: Reply with quote

memays,

Can be done using DFSORT. Do you have a file that consists the list of files that you need to count the records?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
memays
Beginner


Joined: 18 Dec 2008
Posts: 4
Topics: 2

PostPosted: Fri Aug 22, 2014 1:03 pm    Post subject: Reply with quote

Yes, I have a list, and can easily generate a JCL step for each file, but may not know the LRECL for each one.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Fri Aug 22, 2014 1:31 pm    Post subject: Reply with quote

memays,

Use the following DFSORT/ICETOOL JCL which will give you the desired results


Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN01     DD DISP=SHR,DSN=Your input fb 300 lrecl file         
//IN02     DD DISP=SHR,DSN=Your input vb 2345 lrecl file       
//IN03     DD DISP=SHR,DSN=your input fb 80 lrecl file
....
all your files
     
//OUT      DD DSN=Your output file with Counts,                   
//            DISP=(MOD,CATLG,DELETE),                       
//            SPACE=(CYL,(25,25),RLSE)
//*                         
//TOOLIN   DD *                                               
  COUNT FROM(IN01) WRITE(OUT) TEXT('COUNT OF FILE 01 IS ') - 
         EDCOUNT(A1,U10) WIDTH(80)                           
  COUNT FROM(IN02) WRITE(OUT) TEXT('COUNT OF FILE 02 IS ') - 
         EDCOUNT(A1,U10) WIDTH(80)                           
  COUNT FROM(IN03) WRITE(OUT) TEXT('COUNT OF FILE 03 IS ') - 
         EDCOUNT(A1,U10) WIDTH(80)                           
  ....
  count statement for all your files.
//*


The output will have RECFM=FB and LRECL=80 and will have the data that looks like this

Code:

COUNT OF FILE 01 IS           2430
COUNT OF FILE 02 IS             64
COUNT OF FILE 03 IS              2

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
memays
Beginner


Joined: 18 Dec 2008
Posts: 4
Topics: 2

PostPosted: Fri Aug 22, 2014 2:08 pm    Post subject: Reply with quote

Excellent! Works perfectly! Thanks for the quick solution. Thank You
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Fri Aug 22, 2014 2:44 pm    Post subject: Reply with quote

memays wrote:
Excellent! Works perfectly! Thanks for the quick solution. Thank You


Cool. I am not sure how you generated the Dataset list but here is an option to generate the dynamic ddnames and filenames in the count text and submit the job to the internal reader.

Take a look at the output from Step0200 and then if everything looks ok then change the statement
Code:

//SORTOUT  DD SYSOUT=*

to
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR),RECFM=FB


Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                               
MEMAYS.FROM.COBOL                         
MEMAYS.BASE.CODE.VSAM                   
MEMAYS.BB.UNMATCHD.KEEP                       
MEMAYS.BLUEREXX.RC                             
MEMAYS.BRCKTS.TEXT                             
MEMAYS.BRODCAST.LIST                           
MEMAYS.CC.BASE.MAC01V4                         
MEMAYS.CC.BASE.MAC01V4.SORTED                 
MEMAYS.CC.BASE.MAC03V4                         
MEMAYS.CC.BASE.MAC03V4.SORTED                 
MEMAYS.CC.BASE.MAC04V4.SORTED                 
MEMAYS.CC.BASE.MAC05V4.CONSORT                 
MEMAYS.CICSTP1.TEXT                           
MEMAYS.CICSTP2.TEXT                           
MEMAYS.CP3Y2U                                 
MEMAYS.CP7Y4T                                 
MEMAYS.DATEINP.FOR.COBOL               
MEMAYS.DATEINP.FOR.ASM                     
MEMAYS.DAVERPT.CSV                             
MEMAYS.DDNAME                                 
MEMAYS.DNET973.BRADSEG.BS2A.SMF               
MEMAYS.DQLVARD.CSV                             
MEMAYS.D0125.T1859                             
MEMAYS.D0322.T2359                             
MEMAYS.D0325.T0859                             
MEMAYS.HDR                               
MEMAYS.FINDREP                       
MEMAYS.FREECLSE.JOB                           
MEMAYS.GDG.TEST.G0001V00                       
MEMAYS.GDG.TEST.G0003V00                       
MEMAYS.GDG.TEST.G0005V00                       
MEMAYS.GDG.TEST.G0006V00                       
MEMAYS.GDG.TEST.G0007V00                       
MEMAYS.GEN1.TEXT                               
MEMAYS.HCLIENT.DEFAULTS                       
//DDNAME   DD DSN=&&DD,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//TCARDS   DD DSN=&&TC,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//SYSIN    DD *                                           
  OPTION COPY,STOPAFT=999                                 
  OUTFIL FNAMES=DDNAME,                                   
  BUILD=(C'//IN',SEQNUM,3,ZD,                             
         C'   DD DISP=SHR,DSN=',1,44,80:X)                 
  OUTFIL FNAMES=TCARDS,                                   
  BUILD=(C'COUNT FROM(IN',SEQNUM,3,ZD,                     
         C') WRITE(OUT) EDCOUNT(A1,U10) WIDTH(80) - ',/,   
         C'TEXT(''',1,44,C' :''',C')',80:X)               
//*                                                       
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DATA,DLM=$$                                 
//COUNTINT JOB (DA26,001,098,J69),'MEMAYS',               
//             CLASS=A,                                   
//             MSGCLASS=H,                                 
//             MSGLEVEL=(1,1),                             
//             TIME=(,15),                                 
//             NOTIFY=MEMAYS                               
//*                                                       
//FILECNT  EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//OUT      DD DSN=MEMAYS.COUNTS.MULT.FILES,               
//            DISP=(MOD,CATLG,DELETE),                     
//            SPACE=(CYL,(5,5),RLSE)                       
//TOOLIN   DD *                                           
$$                                                         
//         DD DISP=SHR,DSN=&&TC                           
//         DD DISP=SHR,DSN=&&DD
//SORTOUT  DD SYSOUT=*                           
//*SORTOUT  DD SYSOUT=(*,INTRDR),RECFM=FB                   
//SYSIN    DD *                                           
  OPTION COPY                                             
//*


The output will be
Code:

MEMAYS.FROM.COBOL                            :       735,347
MEMAYS.BASE.CODE.VSAM                        :            98
MEMAYS.BB.UNMATCHD.KEEP                      :             0
MEMAYS.BLUEREXX.RC                           :            64
MEMAYS.BRCKTS.TEXT                           :             2
MEMAYS.BRODCAST.LIST                         :             0
MEMAYS.CC.BASE.MAC01V4                       :       350,000
MEMAYS.CC.BASE.MAC01V4.SORTED                :       350,000
MEMAYS.CC.BASE.MAC03V4                       :       330,000
MEMAYS.CC.BASE.MAC03V4.SORTED                :       330,000
MEMAYS.CC.BASE.MAC04V4.SORTED                :       330,000
MEMAYS.CC.BASE.MAC05V4.CONSORT               :     1,400,000
MEMAYS.CICSTP1.TEXT                          :        21,645
MEMAYS.CICSTP2.TEXT                          :        64,598
MEMAYS.CP3Y2U                                :           199
MEMAYS.CP7Y4T                                :       735,432
MEMAYS.DATEINP.FOR.COBOL                     :     3,652,059
MEMAYS.DATEINP.FOR.ASM                       :     3,652,059
MEMAYS.DAVERPT.CSV                           :            31
MEMAYS.DDNAME                                :         3,500
MEMAYS.DNET973.BRADSEG.BS2A.SMF              :           277
MEMAYS.DQLVARD.CSV                           :           202
MEMAYS.D0125.T1859                           :            12
MEMAYS.D0322.T2359                           :            12
MEMAYS.D0325.T0859                           :            12
MEMAYS.HDR                                   :             1
MEMAYS.FINDREP                               :            98
MEMAYS.FREECLSE.JOB                          :            71
MEMAYS.GDG.TEST.G0001V00                     :             1
MEMAYS.GDG.TEST.G0003V00                     :             1
MEMAYS.GDG.TEST.G0005V00                     :             1
MEMAYS.GDG.TEST.G0006V00                     :             1
MEMAYS.GDG.TEST.G0007V00                     :             1
MEMAYS.GEN1.TEXT                             :            11
MEMAYS.HCLIENT.DEFAULTS                      :           657   

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group