Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to count record count of more than one file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to count record count of more than one file
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

Senior Member


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

PostPosted: Wed Aug 12, 2009 4:53 pm    Post subject:
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    Post subject:
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: 2161
Location: @my desk

PostPosted: Wed Aug 12, 2009 5:12 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 2161
Location: @my desk

PostPosted: Wed Aug 12, 2009 5:52 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 12, 2009 5:58 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 12, 2009 6:13 pm    Post subject:
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: 2161
Location: @my desk

PostPosted: Wed Aug 12, 2009 7:09 pm    Post subject:
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

Site Director


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

PostPosted: Wed Aug 12, 2009 10:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us