MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EXCLUSIVE LOCK for ISPF Table

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Fri Sep 28, 2018 1:34 am    Post subject: EXCLUSIVE LOCK for ISPF Table Reply with quote

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


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Sep 28, 2018 1:49 am    Post subject: Reply with quote

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


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Fri Sep 28, 2018 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Sep 28, 2018 12:24 pm    Post subject: Reply with quote

deepa12 wrote:
I think it is because these commands are not being recognized in the REXX


deepa12,

If you want to run IPCS in batch you need to a lot more than a simple VERBX. You need to allocate the DUMP directory and the call syntax for VERBX is

Code:

SYSCALL doipcs CMD('verbx asmdata ''full''') 


Please spend time reading the documentation and understand the syntax. Check this link

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.ieac500/cltask.htm
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group