I want to read all the member of the partitioned data set inside my program, (not only one at time) and I don't know how to understand the end of each member inside the partitioned. This is my real problem
Bye and thank you
I did some research, and I am beginning to understand what you are dealing with. Below are some tips, although I have not used a COBOL program to read Partitioned Data Sets (PDS).
If what you need to do is simulate the TSO LISTDS MEMBERS command using COBOL, then, I may help a little.
The following link lists a program written in C to read the PDS directory one block (256 bytes) at a time, decode each block and extract the member name. Apparently 'member' occupies the first 8 bytes of each block; these bytes will contain LOW-VALUES (or HIGH-VALUES) when there are no more members.
I did this about 30 years ago. I don't remember whether I did it in COBOL or ASM. A PDS consists of two parts, the directory and the member files. You can read the directory using BSAM. It consists (I believe) of 256 byte records. There are 16 16-byte entries in each record, as I recall. Each entry contains the name of the member, its address, and whether it is an alias. The entries in the directory are maintained in ascending order. If the JCL statement points to the PDS without a member name, you will get the directory. You must specify the correct record size in COBOL, which I believe is 256, unblocked.
To read the members, once you have the member name, you need to use another file (DD) name. I think I wrote an ASM subroutine to allow you to stuff the member name before opening the file.
The IBM Technical manuals tell the details of the directory.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.