Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

partitioned data set 1

Status
Not open for further replies.

Robertge

Programmer
Jul 4, 2002
18
IT
Hi.

Someone know how is possible to read a paqrtitioned data set from a cobol program without make a copy into a sequential file?

Thanks
 
Hi Robertge,

I am a little confused by your question. I probably don't fully understand what is being asked.

But, here are a few thoughts.

COBOL can read several types of file structures, including indexed and entry sequenced.

Partitionning a file does not affect how COBOL handles the file. It is treated the same way as a non-partionned file.

What is the structure of the file you need to read? We may be able to give you some tips.

Dimandja
 
Yes, Dimandja , is true...

Sorry I forget something.

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

 
Hi Robertge,

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.


Dimandja
 
Hi,

I don't know either how to read the partitioned dataset myself, but I know there are people outside whom are doing it. You can find sources etc. at
But, if I am processing sources, jcl or other text-like partitioned datasets, I define a search and search for a space: ' '

Every source line contains a space.

Watch the search output: For every member it contains '(S)' on a certain column and there are more specific characteristics.

I even have a source myself on the pc environment that creates separate source members out of such a search output.

I hope this helps!

Regards,

Crox
 
Hi Robertge,
Are you able to access ISPF Dialog Manager? This is the IBM supplied SPF/PDF bit of TSO that can be accessed from a COBOL program.

If you are, I think that you can call ISPLINK to open the pds, read each member, or member name, and pull each member in as a spearate file.

Let me know if you can use this at our installation, and if you require further info.

Regards,

Marc
 
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.
 
Forgot to mention, because the entries can vary in length, you'd best be advised to define it as recfm=u,blksize=256.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top