View previous topic :: View next topic |
Author |
Message |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Wed Nov 09, 2005 1:25 pm Post subject: Finding number of records in a PS / PDS member through JCL |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Ravi Beginner
Joined: 27 Jun 2005 Posts: 88 Topics: 2
|
Posted: Wed Nov 09, 2005 1:34 pm Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Nov 09, 2005 1:46 pm Post subject: |
|
|
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 |
|
 |
Ravi Beginner
Joined: 27 Jun 2005 Posts: 88 Topics: 2
|
Posted: Wed Nov 09, 2005 2:02 pm Post subject: |
|
|
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 |
|
 |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Thu Nov 10, 2005 4:52 am Post subject: |
|
|
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 |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Nov 10, 2005 5:32 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu Nov 10, 2005 5:37 am Post subject: |
|
|
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 |
|
 |
|
|