MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Finding number of records in a PS / PDS member through JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Wed Nov 09, 2005 1:25 pm    Post subject: Finding number of records in a PS / PDS member through JCL Reply with quote

Hi

Can anybody help me in finding out number of records in a PS / PDS member through JCL or REXX etc... I have very big PS files which contain around 2000000 records. I need to make a note of the number of record for these files. As of now, I am opening that file, typing "M" in the command line and pressing "F8" PF key. It is taking hell a lot of time. Can anybody make my job easy.

Regards
Sridhar P
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Nov 09, 2005 1:34 pm    Post subject: Reply with quote

psridhar,

please search before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=7&highlight=count

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Wed Nov 09, 2005 1:34 pm    Post subject: Reply with quote

Copy the files to some temp files and then you can see the counts SYSOUT.
Code:

//STEP010  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=your input file,DISP=SHR
//SORTOUT  DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY


Quote:

SYSIN :
SORT FIELDS=COPY
WER108I SORTIN : RECFM=F ; LRECL= 400; CISIZE = 4096
WER110I SORTOUT : RECFM=FB ; LRECL= 400; BLKSIZE= 27600
WER054I RCD IN 5835, OUT 5835
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Nov 09, 2005 1:46 pm    Post subject: Reply with quote

Quote:

Copy the files to some temp files and then you can see the counts SYSOUT.
Code:


why temp files? just dummy the output dataset !

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Wed Nov 09, 2005 2:02 pm    Post subject: Reply with quote

Yes Kolusu.. thats right. We can use DUMMY. It definely works.

A Rexx solution .. but this is just to start your code. With the below code you have to open a dataset and then give %LINECNT on the command line.

You can modify the below code to make this a bit more dynamic.
Code:

/* REXX  GIVES THE # OF RECORDS IN THE OPENED FILE */
/*  Name: LINECNT */
address isredit
"macro"
/* 1 way       */
"cursor = .zl"
"(lastline,x) = cursor"
say lastline

/* another way */
"(records) = linenum .zlast"    /* zlast or zl */
say records

*****************************************************************************
Edited post: 11/9/2005 4:10 PM
Usage:
TSO FINALSTP
Code:

/* rexx */
/* Name: FINALSTP
 mycount YOUR.DATA.SET.NAME1
 mycount YOUR.DATA.SET.NAME2
 mycount YOUR.DATA.SET.NAME3
 mycount YOUR.DATA.SET.NAME4
Output:
YOUR.DATA.SET.NAME1 : 00002208
YOUR.DATA.SET.NAME2 : 00250218
YOUR.DATA.SET.NAME3 : 00245381
YOUR.DATA.SET.NAME4 : 00247589

MYCOUNT rexx code
Code:
/* REXX  GIVES THE # OF RECORDS OF GIVEN FILE */
/* Name : myCOUNT */
 arg zdsn
address ispexec
"LMINIT DATAID(DATA1) DATASET('"zdsn"') ENQ(SHR)"
'lmopen dataid('data1') option(input)'
Address ispexec 'EDIT DATAID('data1') MACRO(LINECNT)'
Address ispexec 'LMCLOSE DATAID('data1')'
Exit  0

LINECNT rexx code
Code:

/* REXX  GIVES THE # OF RECORDS IN THE OPENED FILE */
/*  Name: LINECNT */
address isredit
"macro (LINECNT)"
/* 1 way       */
"cursor = .zl"
"(lastline,x) = cursor"
"(mydsn)= dataset"
say  mydsn || ' : ' || lastline
"END"


Please use this code with caution. There is no error handling.
I don't know why but I spent lot of time on this and it was a bit interesting.
And this works only for PS. (Not intended for PDS) If you want to get PDS info then definetly you need to tweek with MEMBER option
Back to top
View user's profile Send private message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Thu Nov 10, 2005 4:52 am    Post subject: Reply with quote

Hi,

Thanks for the reply. Now my job became much more simple.

Kolusu,

You said just search before posting. I did it with the key words "find record count jcl" in JCL topic. I found 175 results and I read every thing but I could not find this topic. Are there any tips for effective search.

Regards
Sridhar P
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Nov 10, 2005 5:32 am    Post subject: Reply with quote

psridhar,

To search with multiple keywords - separate each word by either an AND or OR - Instead of enclosing them within double quotes.

Thanks,
Phantom
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Nov 10, 2005 5:37 am    Post subject: Reply with quote

Also click on the option "Search for all terms".
Quote:

I did it with the key words "find record count jcl" in JCL topic

I searched by clicking this option. It gave only 5 results.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group