ISPF table leaves an ENQ outstanding.



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

ISPF table leaves an ENQ outstanding.

Postby Richard Eden » Fri Nov 02, 2012 4:16 pm

I have a REXX procedure which updates an ISPF table. It allocates the table library and opens the table like this:

address TSO
"allocate dataset('"||tabllib||"') file(SH4TLIB) reuse shr"
address ISPEXEC "tbopen "tb_name" write library(SH4TLIB) share"

At the end of the procedure it closes the table and frees the library like this:

address ISPEXEC "tbclose "tb_name" library(SH4TLIB)"
address ISPEXEC "tbopen junk library(ddjunk)"
address TSO
"free f(SH4TLIB)"

The procedure all works fine, but it leaves an outstanding EXCL OWNER ENQ on the table library. Any ideas on how I can delete this ENQ?

Thanks for any help and advice.
Richard.
Richard Eden
 
Posts: 10
Joined: Fri Nov 26, 2010 8:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISPF table leaves an ENQ outstanding.

Postby Akatsukami » Fri Nov 02, 2012 4:47 pm

Why do you allocate the library with ALLOC rather than LIBDEF?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: ISPF table leaves an ENQ outstanding.

Postby Richard Eden » Fri Nov 02, 2012 5:16 pm

Thanks for the response.

I tried allocating the library and opening the table like this:

address TSO
"allocate dataset('"||tabllib||"') file(SH4TLIB) reuse shr"
address ISPEXEC "libdef ISPTLIB dataset ID('"||tabllib||"')"
address ISPEXEC "tbopen "tb_name" write library(SH4TLIB) share"

And closing it like this:

address ISPEXEC "tbclose "tb_name" library(SH4TLIB)"
address ISPEXEC "tbopen junk library(ddjunk)"
address ISPEXEC "libdef ISPTLIB"
address TSO
"free f(SH4TLIB)"

but it made no difference. I still have the outstanding ENQ.
Richard Eden
 
Posts: 10
Joined: Fri Nov 26, 2010 8:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISPF table leaves an ENQ outstanding.

Postby Akatsukami » Fri Nov 02, 2012 6:57 pm

You shouldn't need to use ALLOC and FREE. I'm just settling down in my office at the moment, so it'll be 15 minutes or so until I can test, but try:
address ispexec "LIBDEF SH4TLIB DATASET ID('"tablib"')"
address ispexec "TBOPEN "tb_name" WRITE LIBRARY(SH4TLIB)"
(other stuff)
address ispexec "TBCLOSE "tb_name" LIBRARY(SH4TLIB)"
address ispexec "LIBDEF SH4TLIB"
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: ISPF table leaves an ENQ outstanding.

Postby Pedro » Fri Nov 02, 2012 10:58 pm

address ISPEXEC "tbopen junk library(ddjunk)"

Somehow, this seem unnecessary.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: ISPF table leaves an ENQ outstanding.

Postby Richard Eden » Tue Nov 06, 2012 4:38 pm

The address ISPEXEC "tbopen junk library(ddjunk)" statement is necessary because:

If the LIBRARY parameter is used with a table service, the user is not able to free
the ddname for the table library pointed to by the LIBRARY parameter.
ISPF keeps this library open until a new ddname is used in the LIBRARY
parameter with another table service. ISPF functions in this manner
for performance reasons.

Issuing a table service with a LIBRARY parameter containing a ddname that does not exist causes the previous
library to be closed and therefore allows the user to free the previous
ddname. Use of CONTROL ERRORS RETURN may be used to guard against
a severe error as a result of a ddname not existing.

I changed my code to use LIBDEF instead of ALLOC as you suggested, and this seems to work all right - I no longer have outstanding ENQs.

Thanks for your help.
Richard.
Richard Eden
 
Posts: 10
Joined: Fri Nov 26, 2010 8:07 pm
Has thanked: 0 time
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post