Maxcc0
Maxcc0

Reputation: 49

Read the size of the member of the pds

How to read the size of the member of a pds file. A pds file has many members. If we browse a pds we can see the member names, their creation date, time user, size, etc. So how to get these attributes separately in variables.

Upvotes: 0

Views: 1685

Answers (4)

MikeT
MikeT

Reputation: 57073

It's been ages, but if the PDS does not have ISPF stats (or the STATS are dubious (eg they can be changed outside of ISPF)). Then you could look to processing the directory.

However, by default a PDS directory doesn't contain that much info, so unless ISPF stats exist you couldn't get much info. What a PDS directory does have is a user-definable area and it's that area hat ISPF utilises. This area is preceeded by a length descriptor (see link for more info).

Another reason why ISPF stats may not exists or be accurate, is that, I think (if I recall correctly), that you can remove the stats, which can free some directory space (potentially get around E37 Abend or circumvent it happening).

I can't recall having tried with Rexx (did write an Assembler PDS unload utility), but you might be able to open and read the directory using EXECIO on the BASE name of the PDS (ie not including (member)).

The directory is blocked at 256 bytes. More info in regards to the structure can be found here PDS Directory. I don't believe that this would work properly for PDSE's though.

Upvotes: 0

Bruce Martin
Bruce Martin

Reputation: 10553

If running under TSO/ISPF (you can do this in batch as well), you can use the LMMFIND service with the stats(yes) option. You will have to do

before you do the LMFIND. Also as zarchasmpgmr you will need to do LMCLOSE and LMFREE

If you want to display a member list, have a look at LMMDISP

Upvotes: 2

zarchasmpgmr
zarchasmpgmr

Reputation: 1434

Be aware that the statistics you write about are maintained by ISPF. There are many ways to create a member outside of ISPF, and those members will not have those statistics. The ISPF service LMMSTATS will set those stats (the 3.5 R panel is a front end to that service). The order of calls is

For some reason, LMMSTATS doesn't require the LMOPEN and LMCLOSE services.

Upvotes: 0

Marv Knight
Marv Knight

Reputation: 416

As Bruce mentioned LMMFIND will have the ISPF statistics for a PDS member. Make sure to use the STATS YES on the service. Also, you may need to check for extended stats (variable ZLEXT ). A site may chose to use extended stats if the member size exceeds 64K. Please refer to the ISPF services Guide. Below is the link for LMMFIND in the 2.1 manual.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.f54sg00/lmmfind.htm%23lmmfind

Upvotes: 3

Related Questions