View previous topic :: View next topic
|
Author |
Message |
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Code as many number of steps as many files are there. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you could use synctool and have the DFSORT equivalent of CNTL, and then it would be just one step. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
Anuj Dhawan wrote: |
Code as many number of steps as many files are there. |
sigh, that's what i am dong. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
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 |
|
|
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then I would definitely go along with Disk's suggestion of a REXX script. |
|
Back to top |
|
|
kennedy_zhu
New User
Joined: 30 Nov 2007 Posts: 27 Location: China
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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
as
Code: |
//OUT DD SYSOUT=(*,INTRDR) |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|