140 pts.
 AS/400 V5R4 – Trying to run a system save in nightly routines.
AS/400 V5R4 - Trying to run a system save in nightly routines. ENDSYS *ALL submitted to QCTL with parameter BCHTIMLMT set for enough time for SAVSYS to run. System does go into restricted state but then Subsystem QCTL starts straight after (2 mins). How do I keep system in a resricted state? What am I missing?

Software/Hardware used:
OS/400 R5V4
ASKED: June 24, 2010  3:24 PM
UPDATED: June 28, 2010  7:44 AM

Answer Wiki:
Without seeing your code or job log it is very hard to tell, but my first suspicion would be the BCHTIMLMT. Remember it is in minutes. I am using this process thru the Job Scheduler and have been for many years. It does work. Put a copy of your code or the job log for us to review. Hope This Helps, Bill Poulin
Last Wiki Answer Submitted:  June 24, 2010  5:09 pm  by  wpoulin   2,480 pts.
All Answer Wiki Contributors:  wpoulin   2,480 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

This procedure (attached photocopy) is in part of our auto Day End procedure within System 21 machine manager.

PGM
SBMJOB  CMD(ENDSBS SBS(*ALL) OPTION(*IMMED) BCHTIMLMT(120)) JOB(END_SUBS) JOBQ(QCTL)

DLYJOB  DLY(300)

the CLP then continues with INZTAP, SAYSYS & SAVLIB none of which run as the system begins its startup routines as soon as the system is in a restricted state (almost as if the BCHTIMLMT is set to less than a minute).

David
 140 pts.

 

ITDavid,

I see that you are doing a SBMJOB to QCTL, but what Subsystem is the Program that I am looking at running in ?
In my mind this whole program should be Submitted to Qctl and the first statement should be the EndSbs *all.

Hope this helps,
Bill Poulin

 2,480 pts.

 

Bill

That makes sense, my only problem is that the Stystem/21 Program Manager runs from Qinter I believe. I shall look into this next week.

Thanks
David

 140 pts.

 

ITDavid,

The whole idea of putting the system in a Restricted State is that all Subsystems are ended, (including Qinter) except for Qctl, the Controlling Subsystem and that no other jobs are running expect your Backup Job.

Hope this helps,
Bill Poulin

 2,480 pts.

 

IBM recommends shutting down TCP/IP first.
I always initialize the tape before shutting down the system because if the tape fails, no point in shuttind down the system.

The code snippet from my backup program has been working for at least 2 years now:

SHUTDOWN1:                                                                 
                                                                           
            ENDTCPSVR  SERVER(*ALL)                                        
            MONMSG     MSGID(CPF9999 CPF0000)                              
                                                                           
            DLYJOB     DLY(180)                                            
            MONMSG     MSGID(CPF9999 CPF0000)                              
                                                                           
            ENDTCP                                                         
            MONMSG     MSGID(CPF9999 CPF0000)                              
            DLYJOB     DLY(180)                                            
                                                                           
            ENDWTR     WTR(*ALL) OPTION(*IMMED)                            
            MONMSG     MSGID(CPF9999 CPF0000)                              
                                                                           
            DLYJOB     DLY(120)                                            
                                                                           
SHUTDOWN2:                                                                 
                                                                           
            ENDSBS     SBS(*ALL) OPTION(*IMMED) DELAY(30) BCHTIMLMT(300)   
            /* BCHTIMLMT should start the system again at 0600.  */        
            /* Ignore any errors - try to get a backup.          */        
                                                                           
            MONMSG     MSGID(CPF0000 MCH0000)                              
                                                                                
            DLYJOB     DLY(600)                                                 
            /* wait for 10 minutes for subsystems to end.  */                   
                                                                                   
******************************************************************************/ 
*           Add reply list entries to avoid tape failures.                   */ 
******************************************************************************/ 
                                                                                
            ADDRPYLE   SEQNBR(2001) MSGID(CPA4088) RPY(C)                       
            MONMSG     CPF2555                                                  
            ADDRPYLE   SEQNBR(2002) MSGID(CPA4086) RPY(C)                       
            MONMSG     CPF2555                                                  
            ADDRPYLE   SEQNBR(2003) MSGID(CPA4278) RPY(I)                       
            MONMSG     CPF2555                                                  
                                                                                
******************************************************************************/ 
*           Start a full system backup.                                      */ 
******************************************************************************/ 
SAVSYS:                                                                         
            IF         COND(&DAY = *THU) THEN(DO)                               
                  SAVSYS     DEV(&DEVD) ENDOPT(*LEAVE)                          
                   MONMSG     MSGID(CPF0000 CPF9999)                            
                   SNDMSG     MSG('@@@@ SAVSYS completed.') TOMSGQ(*HSTLOG)     
                   MONMSG     MSGID(CPF0000 CPF9999)                            
             ENDDO       

 325 pts.

 

Within BRMS and a tape magazine unit you can set this up and it will automatically shut down the subsystems, find and clear an available tape, do the full system save and restart the system. The only fancy code is adding a reply list entry beforehand and removing this afterwards.

 195 pts.

 

We do a weekly save of the entire system with BRMS. We have a Backup procedure running and in the weelly process it checks if the BRMS console monitor is running. If it is not we do a normal save, if it is we Submit a control group to the BRMS console. BRMS starts QCTL after the save completes.

 2,280 pts.

 

dear,

i have a question, if we want to do a policy before starting the End Of Day (as400 system, equation system) what you have from ideas to help us on it?

thanks in advanced

 10 pts.