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

how to count record count of more than one file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 2:40 pm
Reply with quote

Hi,

I have one issue about the record count.
I have a list of PS file, which need to count the record number of each one. So far, I use SYNCSORT ( 1.2.3.1 ) to count the record number, one sort step, one record count.

//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input file,
// DISP=SHR
//SORTOUT DD DSN=output file,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('NO OF RECORDS: ',COUNT=(M11,LENGTH=8))
/*

As we know, when the list contain plents of PS file name, that would be terrible. Is there an easier way to calculate the record number of every file?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Aug 12, 2009 4:53 pm
Reply with quote

Code as many number of steps as many files are there.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 12, 2009 5:05 pm
Reply with quote

you could use synctool and have the DFSORT equivalent of CNTL, and then it would be just one step.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 12, 2009 5:12 pm
Reply with quote

Quote:
when the list contain plents of PS file name, that would be terrible
Did you mean "plenty" of files? How many? And how you are going to use this information? May be you can generate as many SYNCTOOL 'TOOLIN' COUNT statements as there are records in your input file corresponding to each file-name to COUNT the records in each file.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 5:45 pm
Reply with quote

Anuj Dhawan wrote:
Code as many number of steps as many files are there.


sigh, that's what i am dong.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 12, 2009 5:50 pm
Reply with quote

1. I would code a dummy destination file - no need to generate more files when all you want to do is count.

2. you could easily write a REXX Script - plenty of examples in the forum - to generate the jcl for each step based on the input file containing the file names of uncounted records.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 5:52 pm
Reply with quote

dbzTHEdinosauer wrote:
you could use synctool and have the DFSORT equivalent of CNTL, and then it would be just one step.


Sounds great. I would try, hope the env support it. : )
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 12, 2009 5:52 pm
Reply with quote

Quote:
sigh, that's what i am dong.
You dont really need to do so. At least if you bother to answer the questions asked above.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 5:56 pm
Reply with quote

arcvns wrote:
Quote:
when the list contain plents of PS file name, that would be terrible
Did you mean "plenty" of files? How many? And how you are going to use this information? May be you can generate as many SYNCTOOL 'TOOLIN' COUNT statements as there are records in your input file corresponding to each file-name to COUNT the records in each file.


Bingo. I have to deal with about 100 fixed ps files. what I am doing is that get the file name from the list, then write down the total record count for every file. and this is not one-time task. so I try to find out some easy way to hand this. anyway, thx for your gently information.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 5:58 pm
Reply with quote

dbzTHEdinosauer wrote:
1. I would code a dummy destination file - no need to generate more files when all you want to do is count.

2. you could easily write a REXX Script - plenty of examples in the forum - to generate the jcl for each step based on the input file containing the file names of uncounted records.


all right, I would try to find some rexx sample to handle this. thx.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 12, 2009 5:58 pm
Reply with quote

Then I would definitely go along with Disk's suggestion of a REXX script.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Wed Aug 12, 2009 6:04 pm
Reply with quote

arcvns wrote:
Quote:
sigh, that's what i am dong.
You dont really need to do so. At least if you bother to answer the questions asked above.


take it easy, i just feel a little boring about the task i am doing.
in my opinion, it's a manner you should respond other guys's answer, especially, i open this new topic, and get lots of useful information, do you think so?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 12, 2009 6:13 pm
Reply with quote

I guess the only downer is having to know the DCB attributes of the input file to be able to DUMMY the output file.

Or is SYNCSORT not the same as DFSORT and these are not required.

If yo have access to the Tape Management Software, it might be easier to get a list of all tapes, and get the info that way.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 12, 2009 7:09 pm
Reply with quote

kennedy_zhu,

You can use the below SYNCTOOL job to generate the jcl to count the records. I assumed the file-names to be present in positions 1-44
Code:
//STEP1  EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN       DD DSN= Input file list (FB/80)                       
//T1       DD DSN=&&T1,DISP=(,PASS)                             
//OUT      DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
 COPY FROM(IN) TO(T1)  USING(CTL1)                               
 SORT FROM(T1) TO(OUT) USING(CTL2)                               
//CTL1CNTL DD *                                                 
 OPTION COPY                                                     
 OUTFIL REMOVECC,                                               
 HEADER1=('//XXXXXXXX JOB (SORT),''COUNT'',CLASS=C,MSGCLASS=A',/,
          '//STEP1  EXEC PGM=SYNCTOOL',/,                       
          '//TOOLMSG  DD SYSOUT=*',/,                           
          '//DFSMSG   DD SYSOUT=*',/,                           
          '//OUT      DD SYSOUT=*',/,                           
          '//TOOLIN   DD *',81:C'1'),                           
 BUILD=(C'//IN',SEQNUM,3,ZD,X,C'DD DISP=SHR,DSN=',1,44,81:C'0',/,
        C'  COUNT FROM(IN',SEQNUM,3,ZD,C') WRITE(OUT)',81:C'2') 
//CTL2CNTL DD *                                                 
 SORT FIELDS=(81,1,CH,A)
 OUTREC BUILD=(1,80)
After verifying the generated JCL in OUT you may change
Code:
//OUT      DD SYSOUT=*
as
Code:
//OUT      DD SYSOUT=(*,INTRDR)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 12, 2009 10:22 pm
Reply with quote

Hello,

Once again, i'm late to the party. . .

Quote:
I have to deal with about 100 fixed ps files. . . . and this is not one-time task.


Why does anyone in your organization believe there is any business value to counting these records (quite a waste for only one time, but this is to be run regularly).

Maybe this system only has tiny files. Most of what i deal with has 10s or 100s of millions of records and to count records for 100 files would be completely unacceptable. . .
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top