View previous topic :: View next topic
|
Author |
Message |
Viktor
New User
Joined: 12 Nov 2010 Posts: 7 Location: Europe
|
|
|
|
Hello all -
I wish to use COBOL to read a JCL dataset with many members. The COBOL program will read the JCL members in order to ascertain which datasets within these JCL jobs are dependent upon another.
The JCL dataset is organized as PO, with Dsntype = LIBRARY, and record length = 80. I have used BPXWDYN in order to find the member names of the JCL dataset.
I used a string similar to the following in conjunction with obtaining member names:
'ALLOC DD(MYPDS) DSN(LABC.XXXX.JCLLIB)'
1) This part has gone well, even though it appears the member name entries have a length of 43 and not 80. (Why ? Directory has own format ???)
After a member name is identified, the pgm shall read the (JCL) member. Here is where I have a problem: this being that all attempts at allocation (and de-allocation) of the member itself are unsuccessful.
Here is one version of the BPXWDYN strings that I have test-used:
'ALLOC DD(MYMBR) DSN(LABC.XXXX.JCLLIB(MBR1))'
2) It seems that enclosing the member name in parentheses is not correct. But then what is correct ? I have tried '[' and quotes and apostrophes as well. I get back a return code 24.
I have numbered my questions for convenience. I have two more questions:
When the COBOL program is run against a dataset with dataset name type = PDS, organization = PO, and recordlength = 80, an error occurs during the COBOL READ (in order to obtain a list of member names):
IGZ0002S JCLXYZ,STEP01 ,10FE,D,SYSIN ,GET ,WRNG.LEN.RECORD,000004CD0000000,QSAM
From compile unit PROGRAMXX at entry point PROGRAMXX at statement 235 at compile unit offset +00001762 at entry offset +00001762 at address 3560274A.
3) What is wrong here and how can this be corrected ?
Thank you for your patience.
P.S. - I have searched the forum for help with BPXWDYN: I have read the 'How to read a record of a file as file in COBOL' thread. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
1) because it was designed in that way
2) reading the directory is different from reading data
3) the thing to be corrected is Your understanding of PDS organization
see
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D470/CCONTENTS?SHELF=DGT2BK81&DN=SC26-7410-08&DT=20080602122917
for all You might want to know aboput PDS
the PDS directory can be read by using a PS dcb with lrecl 256, but You will have to do Your own deblocking and directory demangling
it would be simpler to use the ISPF LMM**** stuff
just one dd and no issues in allocating the single members
even if for such task something with stronger string handling capabilities would be better
I would do the prototyping in rexx and after, if the performance is not satisfactory
switch to a compiled language |
|
Back to top |
|
|
Viktor
New User
Joined: 12 Nov 2010 Posts: 7 Location: Europe
|
|
|
|
Thanks Dick S. and Enrico-S for the prompt answers. I think I will using ISPF LMM services as suggested.
But even if I use ISPF LMM in conjunction with BPXWDYN, I still have to solve the problem of allocating a member of the library.
I studied the allocation string in the COBOL pgm example using LMM, and used the same format in my own COBOL pgm. But when the program was testrun the member still remained allocated with a return code of 24. Here are the different formats I have tried (unsuccessfully):
ALLOC DD(MYMBR) DSN('LABC.XXXX.JCLLIB(MBR1)')
ALLOC DD(MYMBR) DSN("LABC.XXXX.JCLLIB(MBR1)")
ALLOC DD(MYMBR) DA('LABC.XXXX.JCLLIB(MBR1)')
ALLOC DD(MYMBR) DA("LABC.XXXX.JCLLIB(MBR1)")
On the other hand, I am able to successfully allocate the library itself
ALLOC DD(MYPDS) DSN(LABC.XXXX.JCLLIB)
I am at a loss to see what is wrong with my member allocation string.
??? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
In ISPF LM services, you LMINIT the whole PDS. Then, for particular member-processing services, you provide the member name in the service itself.
O. |
|
Back to top |
|
|
Viktor
New User
Joined: 12 Nov 2010 Posts: 7 Location: Europe
|
|
|
|
Hi everyone -
Just a status report in case you are wondering how things are going . . .
Based on the feedback I have gotten from you all, it sounds like using ISPF LM services is a better way to go.
So I have written a COBOL LM pgm based upon the example which was kindly provided in an earlier post. I have finally gotten it to compile but when I testrun it, it results in a series of return code 20s. I shall see if I can find out what the problem is. Probably the JCL to run the job isn't set up right. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Try running it with TRACE & TEST. Also, you might want to DISPLAY the ISPF variables ZERRSM & ZERRLM after each failed service.
O. |
|
Back to top |
|
|
Viktor
New User
Joined: 12 Nov 2010 Posts: 7 Location: Europe
|
|
|
|
Got it to run now.
Thanks everyone for your help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
|