Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear object locks w/o usr logoff 1

Status
Not open for further replies.

keebe418

IS-IT--Management
Feb 21, 2005
13
0
0
US
I am doing a necessary update on one of our programs and need to clear some object locks before continuing.

I know I can remove the lib from their list and have the users log off and log back on, but is there a way I can just clear the locks for this program w/o interrupting the users?

Thanks in advance-
Shawn
 
Not that I'm aware of. If a job or user has an object locked, the job/user must clear the lock or log off. I have a program which disables specific user profiles. We do this just before nightly processing. If you'd like I can send the code. Of course, there's an enable program also.

I hate to say, but I think there will be interruption.

Mark
 
We schedule any program changes that also involve file changes for the middle of the night, after their interactive sessions have timed out and no batch programs are running.

If all you are changing is a batch program that doesn't involve any changes to files along with it, you can do that anytime without a problem. The old program gets placed into a special library (QRPLOBJ) under a different name, and the jobs running the program will continue to point to that program until they end.

If files are being changed, you need an exclusive lock on them, which is why we generally promote things at night.

Da mihi sis crustum Etruscum cum omnibus in eo.

 
Koz-

That's what my experience has been too, just thought I would ask. I'd appreciate the source for the program to disable profiles though.

skaelb [at] bergquistinc.com

Flapeyre-

We always schedule changes at night as well, but there are always special circumstances that require quick programming fixes. In this case we had to take the program down, recompile, and restart but could not with the objlck's from users.

Thanks for the help-
 
CHAD is a library on the system. You'll need to create a few files. Also, each user needs to have a supplimental group "GRPDISABLE" - - - DO NOT ADD THIS TO SYSTEM ACCOUNTS.

DisableCL
Code:
PGM                                                              
                                                                 
             DCL        VAR(&REPLY) TYPE(*CHAR) LEN(1) VALUE(' ')
             DCLF       FILE(CHAD/DISABLEUSR)                    
                                                                 
ERRCHECK:   MONMSG     MSGID(CPF2204)                           
SENDMSGID:  SNDUSRMSG  MSGID(PWD0003) MSGF(BSYOBJ1/CSYMSG1) +         
                         MSGTYPE(*INFO) TOUSR(QSYSOPR)                
                                                                      
CONFIRM:    SNDUSRMSG  MSG('ARE YOU SURE YOU WANT TO DISABLE THE +    
                         USER PROFILES? (Y OR N)') VALUES(Y N) +      
                         DFT(N) MSGRPY(&REPLY)                        
                                                                      
DECISION:   IF         COND(&REPLY *EQ N) THEN(GOTO CMDLBL(NODISABLE))
            IF         COND(&REPLY *EQ Y) THEN(GOTO CMDLBL(DISABLE))  
                                                                      
DISABLE:    DSPUSRPRF  USRPRF(*ALL) OUTPUT(*OUTFILE) +                
                         OUTFILE(CHAD/PROFLIST)                       
                                                                      
            RUNQRY     QRY(CHAD/SELECTDIS)                            
READ:       RCVF                                                   
                                                                   
CHECKEND:   MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(DISABLEMSG))
                                                                   
            CHGUSRPRF  USRPRF(&UPUPRF) STATUS(*DISABLED)           
                                                                   
                                                                   
            GOTO       CMDLBL(READ)                                
                                                                   
DISABLEMSG: SNDUSRMSG  MSG('---=== USER PROFILES ARE DISABLED +    
                         ===---') MSGTYPE(*INFO) TOMSGQ(*SYSOPR)
                                                                
            GOTO       CMDLBL(END)                              
                                                                
END:        ENDPGM

EnableCL
Code:
PGM                                                              
                                                                 
             DCL        VAR(&REPLY) TYPE(*CHAR) LEN(1) VALUE(' ')
             DCLF       FILE(CHAD/DISABLEUSR)                    
                                                                 
ERRCHECK:   MONMSG     MSGID(CPF2204)                           
SENDMSGID:  SNDUSRMSG  MSGID(PWD0004) MSGF(BSYOBJ1/CSYMSG1) +        
                         MSGTYPE(*INFO) TOUSR(QSYSOPR)               
                                                                     
CONFIRM:    SNDUSRMSG  MSG('ARE YOU SURE YOU WANT TO ENABLE THE +    
                         USER PROFILES? (Y OR N)') VALUES(Y N) +     
                         DFT(N) MSGRPY(&REPLY)                       
                                                                     
DECISION:   IF         COND(&REPLY *EQ N) THEN(GOTO CMDLBL(NOENABLE))
            IF         COND(&REPLY *EQ Y) THEN(GOTO CMDLBL(ENABLE))  
                                                                     
ENABLE:     DSPUSRPRF  USRPRF(*ALL) OUTPUT(*OUTFILE) +               
                         OUTFILE(CHAD/PROFLIST)                      
                                                                     
            RUNQRY     QRY(CHAD/SELECTDIS)                           
READ:       RCVF                                                  
                                                                  
CHECKEND:   MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(ENABLEMSG))
                                                                  
            CHGUSRPRF  USRPRF(&UPUPRF) STATUS(*ENABLED)           
                                                                  
                                                                  
            GOTO       CMDLBL(READ)                               
                                                                  
ENABLEMSG:  SNDUSRMSG  MSG('---=== USER PROFILES ARE ENABLED +    
                         ===---') MSGTYPE(*INFO) TOMSGQ(*SYSOPR)
                                                                
            GOTO       CMDLBL(END)                              
                                                                
NOENABLE:   SNDUSRMSG  MSG('---=== USER PROFILES *NOT* ENABLED +
                         ===---') MSGTYPE(*INFO) TOMSGQ(*SYSOPR)
                                                                
            GOTO       CMDLBL(END)                              
                                                                
END:        ENDPGM

Query CHAD/SELECTDIS
Code:
Select and Sequence Fields
  10  UPUPRF
  20  UPTEXT
  30  UPGRPF
  40  UPSUPG

Select Records
       UPSUPG            LIKE   '%GRPDISABLE%'
OR     UPGRPF            LIKE   '%GRPDISABLE%'

Select Output Type and Output form
CHAD/DISABLEUSR
Option 2 (Replace).

Add grpdisable to one or two accounts to test it first. Any questions, let me know.

Mark
 
Thanks Mark, I appreciate the help



-Shawn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top