I would like to know how to access all members of a PDS through a COBOL code.
Thank you
Accessing All members of A PDS Through COBOL program
-
- Posts: 1
- Joined: Fri Nov 09, 2007 8:28 pm
- Skillset: Working on Mainframes
- Referer: Google
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: Accessing All members of A PDS Through COBOL program
You probably will want to use the ISPF LMMLIST Service in your program.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Accessing All members of A PDS Through COBOL program
Hello Subha.siva and welcome to the forums,
Do you want to read each individual member or do you want to read all of the members as a single file?
Do you want to read each individual member or do you want to read all of the members as a single file?
Hope this helps,
d.sch.
d.sch.
Re: Accessing All members of A PDS Through COBOL program
I am creating a simple batch program to call LMMDISP and LMMLIST to see which will be most usefull but I am getting an RC 20. Should the library be allocated in the JCL or do I need to allocate it via LMMINIT or something. Unfortunately, this has to COBOL not rexx or clist. An example would also be really helpfull.
Finally, so I don't have to post again. Where the member information is returned to?
CALL 'ISPLINK' USING BY CONTENT
'LMMDISP '
'CISE.TEST.SOURCE '
'YES '
'DISPLAY'
'CIBPC701'.
IF RETURN-CODE > 0
DISPLAY 'display CALL RC = ' RETURN-CODE.
CALL 'ISPLINK' USING BY CONTENT
'LMMLIST '
'CISE.TEST.SOURCE '
'LIST '
'CIBPC701'
'YES '.
IF RETURN-CODE > 0
DISPLAY 'CALL RC = ' RETURN-CODE.
This is just a proof of concept but I am struggling.
Thanks
Finally, so I don't have to post again. Where the member information is returned to?
CALL 'ISPLINK' USING BY CONTENT
'LMMDISP '
'CISE.TEST.SOURCE '
'YES '
'DISPLAY'
'CIBPC701'.
IF RETURN-CODE > 0
DISPLAY 'display CALL RC = ' RETURN-CODE.
CALL 'ISPLINK' USING BY CONTENT
'LMMLIST '
'CISE.TEST.SOURCE '
'LIST '
'CIBPC701'
'YES '.
IF RETURN-CODE > 0
DISPLAY 'CALL RC = ' RETURN-CODE.
This is just a proof of concept but I am struggling.
Thanks
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: Accessing All members of A PDS Through COBOL program
Like any program that requires ISPF Services, it needs to run from within a TSO/ISPF environment. So, in batch, you need to execute PGM=IKJEFT01, you need to start ISPF and your program (with the ISPSTART command) and you need all of the necessary ISPF Library Definitions in your JCL. Also, from the manual:
and, as you probably know, the individual member names can be retrieved from the appropriate dialog variable.
I've posted an example COBOL program here as a working example.
You must complete the LMINIT and LMOPEN services before using LMMLIST. Use the LMMLIST FREE option to release the list storage space when it is not needed.
and, as you probably know, the individual member names can be retrieved from the appropriate dialog variable.
I've posted an example COBOL program here as a working example.