View previous topic :: View next topic |
Author |
Message |
viswanathan Beginner
Joined: 17 Jan 2006 Posts: 26 Topics: 13
|
Posted: Fri Jan 11, 2008 4:11 am Post subject: Total Size of the members in a PDS |
|
|
Hi Everyone,
Can you help me to find out the total size (total number of lines) of all the members in a PDS?
Thanks,
Vishwa. |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
|
viswanathan Beginner
Joined: 17 Jan 2006 Posts: 26 Topics: 13
|
Posted: Fri Jan 11, 2008 4:58 am Post subject: |
|
|
Thanks for the details vkphani!!
I made a mistake as I didnt give the full requirement at the top.
I need the solution for this situation:
There is a PDS AAA.PROD.SOURC which is the source library.
I need to find the total number of lines for all the members of a pattern inside this PDS. E.g. All members starting with CBM* in PDS AAA.PROD.SOURC.
Kindly help me in this regard.
Thanks,
Vishwa. |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Fri Jan 11, 2008 5:36 am Post subject: |
|
|
Vishwa,
Copy members starting with CBM to a different dataset and follw the link given. There may be some other solution, let's wait for experts. |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Jan 11, 2008 5:05 pm Post subject: |
|
|
You could trap the members within the PDS using these statements:
JUNK = OUTTRAP('MBR.')
"LISTD '" || DSN || "' MEMBERS"
JUNK = OUTTRAP('OFF')
DO I = 1 TO MBR.0
IF MBR.I = "--MEMBERS--" THEN LEAVE
END
If you do some checking within your MBR.I variable, you would be able to see what is returned from the LISTD command. One of the parts in the MBR.I variable is the name of each PDS member.
You could interrogate that PDS member to see if it starts with CBM. If it does, rebuild the file name using your PDS plus the member name.
FULL_NAME = PDS_NAME || "(" || MBR_NAME || ")"
Once the full name has been built, repeat the following for all CBM members:
1. Allocate the FULL_NAME file.
2. Read each record on the file and add 1 for each record read.
3. Free the file.
4. Add record count to a total record count. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Jan 11, 2008 9:38 pm Post subject: |
|
|
LMMLIST supports simple patterns like this too. if you think ISPF stats are reliable enough for your needs (remember, they are not always there and users can set them to any number they want to fairly easily), then just total the line counts from lmmlist. If ISPF stats aren't sufficient you can read each member using ISPF services. At least that way you don't haveto reallocate each member individually which is quite slow. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
|
|
|