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

Counting number of members in a PDS ?


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

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Sep 15, 2005 12:42 pm
Reply with quote

hi,

i need a jcl program icon_question.gif

1)To count number of records in a VSAM
2) To count number of members in a PDS
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Thu Sep 15, 2005 1:12 pm
Reply with quote

Hi,

Quote:
1)To count number of records in a VSAM




Code:
//STEP01  EXEC PGM=SORT                                 
//SYSOUT   DD   SYSOUT=*                               
//SORTIN  DD DSN=VSAM Dataset name,DISP=SHR   
//SORTOUT DD DSN=Output file name,DISP=SHR       
//SYSIN   DD *                                         
  OPTION COPY                                           
  OUTFIL REMOVECC,NODETAIL,                             
   TRAILER1=(COUNT=(M10,LENGTH=02))                     
/*                                                     
//SYSUDUMP   DD SYSOUT=*       


Hope this Helps.

Regards
Rupesh
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Sep 15, 2005 2:47 pm
Reply with quote

can you please explain the sysin DD ?

OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M10,LENGTH=02))
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Sep 15, 2005 2:59 pm
Reply with quote

SYSIN :
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
*
TRAILER1=(COUNT=(M10,LENGTH=02))
WER038I WARNING: SYNCSORT MVS IS NOT CERTIFIED TO RUN ON Z/OS. CONTACT SYNCSORT PRODUCT SERVICES FOR MORE INFORMATION.
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Is there any other option to count ?
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Thu Sep 15, 2005 4:45 pm
Reply with quote

Hi Rameshs!

Looks like syncsort is not installed in your shop. Yo can get the records count thru DFSORT also. Just try with the following code:

Code:
//PS010 EXEC PGM=ICETOOL                         
//TOOLMSG DD   SYSOUT=*                           
//DFSMSG   DD   SYSOUT=*                           
//IN            DD   DSN=datasetname,DISP=SHR
//TOOLIN    DD   DATA                               
  COUNT FROM(IN)                                   
/*                                                 
//*

HTH,
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Sep 15, 2005 4:49 pm
Reply with quote

Hi anuradha,

i tried this code already, this ICETOOL also not avilable..
we r using Z/OS 1.4


Thanks
Ramesh
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 15, 2005 6:02 pm
Reply with quote

To view how many record are in your vsam you can use LISTCAT through IDCAMS and see the item REC-TOTAL.*
Code:
//STEP010I EXEC PGM=IDCAMS                             
//SYSPRINT DD SYSOUT=*                                 
//SYSIN    DD *                                       
 LISTCAT ENTRIES(myvsam) ALL

To view the number of member in a PDS you can enter in PDS and look at top right of ISPF screen where you have the total number or row that is the exact number of member in the library.
Code:
Row 00001 of 06930


Hi hope in this help.

*= after this step you can use SYNCSORT to extract the data you need.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Sep 15, 2005 6:09 pm
Reply with quote

As far as I know, using COUNT FROM(IN) should work with either SORT product (DFSORT, PGM=ICETOOL or SYNCSORT, PGM=SYNCTOOL).

Concerning the number of members of a PDS, nothing specific comes to mind. The best thing I can think of is to use on of the TSO commands, LISTDS or PRINTDS to generate the member list, then use some other utility to accumulate and totals the number of entries.

If you have SAS, using PROC SOURCE might be helpful:
Code:

//SASSTEP  EXEC SAS                       
//SAS.SASLOG  DD SYSOUT=*                 
//SAS.SYSDUMP DD SYSOUT=*                 
//SAS.SASLIST DD SYSOUT=*                 
//SYSUT1   DD DISP=SHR,DSN=MY.PDS         
//MEMBERS  DD SYSOUT=*                     
//SYSIN    DD *                           
PROC SOURCE INDD=SYSUT1 OUTDD=MEMBERS;     
/*                                         
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 Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
Search our Forums:

Back to Top