How to read a PDS Directory List of Members using COBOL?
How to read a PDS Directory List of Members using COBOL?
Hi,
Is it possible to obtains the member list in a COBOL program?
If not, what is the best way of doing this?
Thanks.
Is it possible to obtains the member list in a COBOL program?
If not, what is the best way of doing this?
Thanks.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to read a PDS Directory List of Members using COBOL?
Yes, it is possible -- I've written a COBOL program that produces a report of the ISPF statistics for all members of a PDS. The code is not particularly tricky, but it is definitely well beyond a beginner's level (for example, the PDS directory is 256-byte records no matter what the LRECL of the PDS is).
Re: How to read a PDS Directory List of Members using COBOL?
That sounds interesting, may I ask for the code?
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to read a PDS Directory List of Members using COBOL?
Attached is READPDS2.COB, the COBOL code. It reads a file of PDS data set names, dynamically allocates each, then prints the ISPF statistics (if any) for the PDS.
You do not have the required permissions to view the files attached to this post.
Re: How to read a PDS Directory List of Members using COBOL?
Thank You so much Robert. I've downloaded the readpds2.txt and will be uploading it to Mainframes and work with it.
I'll let you know, how I progress.
Thanks,
I'll let you know, how I progress.
Thanks,
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: How to read a PDS Directory List of Members using COBOL?
I also got intrested in it and downloaded the program. This worked GREAT in a single go, much appreciate your contribution Robert. This is a keeper..
Code: Select all
12013/08/05 READPDS - READ AND DISPLAY PDS ISPF STATISTICS PAGE 1
05:44:04.93 PROGRAM COPYRIGHT BY ROBERT SAMPLE 2012
DSNAME: T1234AD.ABC.EXEC1
0MEMBER NAME ISPF VV.MM CREATE DATE CHANGE DATE CHANGE TIME CURRENT SIZE INITIAL SIZE MODIFIED LNS USER ID
ADDDISP 01.04 2011/12/12 2011/12/12 08:14:44 24 23 0 T1234AD
BANNER 01.00 2013/05/15 2013/05/15 08:39:13 17 17 0 T1234AD
BATCHMAC 01.00 2012/04/04 2012/04/04 10:09:19 32 32 0 T1234AD
TOTAL MEMBERS 3 73 72 0
DIRECTORY BLOCKS READ 1
-DATA SETS PROCESSED 1
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to read a PDS Directory List of Members using COBOL?
Thanks Anuj. These days COBOL is much more versatile than many people realize. I haven't done much with the object-oriented COBOL on z/OS (yet), but I have managed to read a PDS directory as well as process DCOLLECT and SMF data through COBOL (although the SMF program did require one assembler routine for the 64-bit clock values).
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: How to read a PDS Directory List of Members using COBOL?
Yes I agree, as you said - COBOL is much more versatile than many people realize and with OOCOBOL and OpenCobol the possiblites aare multifold now.
I've that "SMF-program" of yours and will be working with that too soon. It's been kept with me for longer than anticipated - (the personal front had been keeping me busy like crazy lately and still is).
I've that "SMF-program" of yours and will be working with that too soon. It's been kept with me for longer than anticipated - (the personal front had been keeping me busy like crazy lately and still is).
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to read a PDS Directory List of Members using COBOL?
Great -- glad to hear that it worked for you.
Re: How to read a PDS Directory List of Members using COBOL?
Hi
Very nice program. You call BPXWDYN for dynamic file allocation. Where is the code for that?
Thanks
Very nice program. You call BPXWDYN for dynamic file allocation. Where is the code for that?
Thanks
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: How to read a PDS Directory List of Members using COBOL?
Hello mrroot and welcome to the Forums,
Yup, that's an excellent piece of code from Robert.
Yup, that's an excellent piece of code from Robert.
You mean the code for BPXWDYN?You call BPXWDYN for dynamic file allocation. Where is the code for that?
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: How to read a PDS Directory List of Members using COBOL?
Very very useful and rare data indeed...
Robert,
Can this code be displayed at Tips?
Robert,
Can this code be displayed at Tips?
zprogrammer
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to read a PDS Directory List of Members using COBOL?
BPXWDYN is an IBM-provided routine to perform dynamic allocation similar to the TSO ALLOC command. It is in one of the system libraries but I don't recall which right now -- when I get a chance I'll see where it shows up.
Anuj -- think the code belongs in Tips?
Anuj -- think the code belongs in Tips?
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute