Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Reading a library member using BPXWDYN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Viktor

New User


Joined: 12 Nov 2010
Posts: 7
Location: Europe

PostPosted: Tue Nov 16, 2010 9:19 am    Post subject: Reading a library member using BPXWDYN
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 16, 2010 10:05 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Did you read this previous topic?
http://ibmmainframes.com/viewtopic.php?t=50781

Or this one with some sample cobol code?
http://ibmmainframes.com/viewtopic.php?t=5501
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Nov 16, 2010 12:30 pm    Post subject: Reply to: Reading a library member using BPXWDYN
Reply with quote

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 icon_biggrin.gif

see
http://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
View user's profile Send private message
Viktor

New User


Joined: 12 Nov 2010
Posts: 7
Location: Europe

PostPosted: Tue Nov 16, 2010 3:45 pm    Post subject: Reply to: Reading a library member using BPXWDYN
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Nov 16, 2010 3:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Viktor

New User


Joined: 12 Nov 2010
Posts: 7
Location: Europe

PostPosted: Wed Nov 17, 2010 1:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 17, 2010 1:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Viktor

New User


Joined: 12 Nov 2010
Posts: 7
Location: Europe

PostPosted: Thu Nov 25, 2010 3:17 pm    Post subject: Reply to: Reading a library member using BPXWDYN
Reply with quote

Got it to run now.

Thanks everyone for your help.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Thu Nov 25, 2010 10:20 pm    Post subject: Reply to: Reading a library member using BPXWDYN
Reply with quote

see
http://ibmmainframes.com/viewtopic.php?t=52204&highlight=
for a members list logic in rexx
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us