View previous topic :: View next topic |
Author |
Message |
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Fri Sep 28, 2018 1:34 am Post subject: EXCLUSIVE LOCK for ISPF Table |
|
|
Please consider the following code in REXX
Code: |
/**REXX**/
STAT=MSG('OFF')
TRACE ?R
ADDRESS TSO "PROFILE NOMSGID NOWTPMSG NOINTERCOM"
DUMMY = OUTTRAP(LINE.)
ADDRESS ISPEXEC CONTROL ERRORS RETURN
ADDRESS ISPEXEC "LIBDEF ISPTLIB DATASET ID('YG22.DEV.ISPTLIB')"
ADDRESS ISPEXEC "LIBDEF ISPTABL DATASET ID('YG22.DEV.ISPTLIB')"
ADDRESS ISPEXEC "TBOPEN TCLTB WRITE"
SELECT
WHEN RC = 0 THEN DO
/* 1ST USER */
APPLN='TCL'
ADDRESS ISPEXEC "TBTOP TCLTB"
ADDRESS ISPEXEC "TBSKIP TCLTB"
ADDRESS ISPEXEC "TBGET TCLTB"
NULL_STR = ''
IF STRIP(TCLUSR) > '' THEN DO
SAY 'APPLICATION IN USE BY ' || TCLUSR
END
ELSE DO
TCLUSR = USERID()
ADDRESS ISPEXEC "TBPUT TCLTB SAVE(TCLUSR)"
END
ADDRESS ISPEXEC "TBCLOSE TCLTB"
END
WHEN RC = 8 THEN DO
/* TABLE NOT ALREADY PRESENT */
/* CREATE TABLE */
ADDRESS ISPEXEC "TBCREATE TCLTB KEYS(APPLN) NAMES(TCLUSR) WRITE"
SAY RC
TCLUSR = USERID()
APPLN='TCL'
ADDRESS ISPEXEC "TBADD TCLTB"
SAY RC
ADDRESS ISPEXEC "TBCLOSE TCLTB"
END
WHEN RC = 12 THEN DO
/* APPLN IS IN USE */
ADDRESS ISPEXEC "TBOPEN TCLTB NOWRITE SHARE"
IF RC = 0 THEN DO
APPLN='TCL'
ADDRESS ISPEXEC "TBTOP TCLTB"
ADDRESS ISPEXEC "TBSKIP TCLTB"
ADDRESS ISPEXEC "TBGET TCLTB"
SAY 'APPLICATION IN USE BY ' || TCLUSR
ADDRESS ISPEXEC "TBCLOSE TCLTB"
END
ELSE
SAY 'APPLICATION IN USE BY ANOTHER USER'
END
OTHERWISE
SIGNAL ERROR
END
PULL INP
IF INP = 'EMPTY' THEN DO
ADDRESS ISPEXEC "TBOPEN TCLTB WRITE"
/* ASSUMED IT WILL BE SUCCESSFUL*/
ADDRESS ISPEXEC "TBTOP TCLTB"
ADDRESS ISPEXEC "TBSKIP TCLTB"
APPLN='TCL'
TCLUSR = ""
ADDRESS ISPEXEC "TBPUT TCLTB SAVE(TCLUSR)"
ADDRESS ISPEXEC "TBCLOSE TCLTB"
END
ADDRESS ISPEXEC "LIBDEF ISPTLIB"
ADDRESS ISPEXEC "LIBDEF ISPTABL"
|
In this code say say 1st user is creating the table & writes the user id
ADDRESS ISPEXEC "TBOPEN TCLTB WRITE"
Even while this person is writing, another user is trying to access this ISPF table or executing the same REXX, then am getting the following message:
MIM1038I YG22 TSU31233 A=022E T=8D91D8 contention with XE57 A=011A T=8B4290 OWNS EXCL on MVSK
MIM1039I YG22 TSU31233 A=022E T=8D91D8 needs EXCL SPFEDIT YG22.DEV.ISPTLIB(TCLTB)
+++ RC(12) +++
I feel even with RC 12, i know that the table is locked. So i would like to suppress this message
Please let me know how to do it |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Sep 28, 2018 1:49 am Post subject: |
|
|
Look at message options
Click HERE _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Fri Sep 28, 2018 6:33 am Post subject: |
|
|
By googling in the same manner i tried the following code:
a.
Code: | DUMMY = OUTTRAP(LINE.)
CALL OUTTRAP "TSOOUTPUTLINE.","*","NOCONCAT"
"VERBX ASMDATA TERM NOPRINT"
CALL OUTTRAP "OFF"
|
In this case it gave RC -3 for VERBX
b.
Code: | ADDRESS TSO "ALLOCATE FILE(DUMMYOUT) DA('XE57.PRINT') SHR REU"
ADDRESS IPCS
"OPEN PRINT (FILE(DUMMYOUT))"
"EVALDEF REXX(CONFIRM(CON) PRINT(PRT) SOURCE(SRC)
TERMINAL(TRM) FLAG(FLG))" /* SAVE USER'S DEFAULTS */
"SETDEF PRINT NOTERMINAL"
"EVALUATE 0FF3458. LENGTH(100) REXX(STORAGE(TEMP))"
|
In this case it gave RC -3 for OPEN PRINT
I think it is because these commands are not being recognized in the REXX
Please suggest |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|