Count the number of records in a file using SORT



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Count the number of records in a file using SORT

Postby RajendraPrabhuS » Fri Jul 24, 2009 11:27 am

Hi, I just want to count the number of records in a file using JCL. Is there any utility to count the number of records? Can anyone help me on this please..
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Count the number of records in a file using SORT

 

Re: How do we count the number of records in a file using JCL?

Postby expat » Fri Jul 24, 2009 12:00 pm

Let us clarify exactly what JCL is.

it is Job Control Language.

By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.

JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.

So which program do you wish to execute to count the records ?
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How do we count the number of records in a file using JCL?

Postby RajendraPrabhuS » Fri Jul 24, 2009 1:53 pm

Thanks Swd....
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How do we count the number of records in a file using JCL?

Postby Alissa Margulies » Fri Jul 24, 2009 7:50 pm

If you have SyncSort for z/OS, here is a sample job that will produce the record count:
//SORT1 EXEC PGM=SORT 
//SYSOUT  DD SYSOUT=*               
//SORTIN  DD DSN=Input.File,DISP=SHR 
//SORTOUT DD DSN=Output.File,...
//SYSIN   DD *                       
   SORT FIELDS=COPY                   
   OUTFIL FILES=OUT,TRAILER1=(1:COUNT),REMOVECC,NODETAIL           
/*                                   
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: How do we count the number of records in a file using JCL?

Postby RajendraPrabhuS » Fri Jul 24, 2009 8:06 pm

Hi Alissa Margulies, Thank for this... Can you please explain the following line.. I don't understand..

SORT FIELDS=COPY
OUTFIL FILES=OUT,TRAILER1=(1:COUNT),REMOVECC,NODETAIL

:?:
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How do we count the number of records in a file using JCL?

Postby Alissa Margulies » Fri Jul 24, 2009 8:22 pm

RajendraPrabhuS,

This job creates a report with a single trailer record containing the record count.

The COUNT subparameter of TRAILER1 provides the number of records for the entire report (all the records) starting at position 1.

REMOVECC omits the ANSI carriage control character from all of the report records.

NODETAIL generates a report with no data records, only header and trailer records, as specified.

Hope this helps. Let me know if you have any further questions.

P.S. All of this is fully documented in the SyncSort for z/OS Programmer's Guide. If you are a licensed customer but do not have access to the documentation, please contact SyncSort Mainframe Product Services and we would be happy to provide them to you.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: How do we count the number of records in a file using JCL?

Postby RajendraPrabhuS » Mon Jul 27, 2009 9:30 am

Thanks you soo much Alissa
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How do we count the number of records in a file using JCL?

Postby sricsc » Fri Aug 14, 2009 10:54 pm

I have a question, can I count the total records in more than one PS file in the same SYNCSORT step ?
Thanks,
Sri
sricsc
 
Posts: 13
Joined: Sat Aug 08, 2009 7:07 am
Has thanked: 0 time
Been thanked: 0 time

Re: How do we count the number of records in a file using JCL?

Postby ranga_subham » Sat Aug 15, 2009 1:42 am

Yes. In that case you would be using PGM=SYNCTOOL instead of PGM=SYNCSORT.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How do we count the number of records in a file using JCL?

Postby sricsc » Sat Aug 15, 2009 11:52 am

Hi Ranga,

Thanks for your response.
But I dont know the how to use the SYNCTOOL. Can you pls tell me the SYNCTOOL syntax & how to use in my job ?
And also how to check the SYNCTOOL is installed in my system ?
Thanks,
Sri
sricsc
 
Posts: 13
Joined: Sat Aug 08, 2009 7:07 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post