Page 1 of 1

display record count

PostPosted: Mon Nov 16, 2009 10:16 am
by samurai007
Hi,

I have a DFSORT job which calculates the record count in a given PS file and writes the result to an output file.
Is there anyway i can display the record count on the ISPF window directly, rather than writing it to an output dataset ?

Thanks,
Dinesh S

Re: display record count

PostPosted: Mon Nov 16, 2009 11:58 pm
by skolusu
samurai007,

The following DFSORT JCL will give you the desired results. It takes care of both fb and vb recfm and sends you a message to the terminal. Code your user-id you want to notify in the user-id section in step0100

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD DSN=&&C1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTFIL REMOVECC,NODETAIL,VTOF,BUILD=(80X),
  TRAILER1=(' SE ''',                                     
            'THE TOTAL NUMBER OF RECORDS IN FILE ARE  : ',
            COUNT,'''',' U(USER-ID)')                 
//*                                                       
//STEP0200 EXEC PGM=IKJEFT01                               
//SYSPRINT DD SYSOUT=*                                     
//SYSTSPRT DD SYSOUT=*                                     
//SYSTSIN  DD DSN=&&C1,DISP=SHR                           
//*

Re: display record count

PostPosted: Tue Nov 17, 2009 7:29 pm
by samurai007
Hey skolusu..

It was perfect.. just wat i wanted.. thanks...

If you don mind, could you please explain TRAILER1 statement alone completely; word-by-word ??
Am quite lost there.

Thanks,
Sam.

Re: display record count

PostPosted: Wed Nov 18, 2009 4:29 am
by skolusu
The trailer1 staement is a creating the message that is needed to send the notification to your terminal.

Trailer1 is creating the following text

 SE 'THE TOTAL NUMBER OF RECORDS IN FILE ARE  : 


and add the COUNT which shows the count of data records as 8 digits with leading zeros suppressed. And finally
' U(USERID)   



Thus resulting in a single line like this

 SE 'THE TOTAL NUMBER OF RECORDS IN FILE ARE  :      341' U(userid)           


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html