TAA Tools
RCLSTGBCH       Reclaim Storage in Batch               TAARCLB

The Reclaim Storage  in Batch command is  designed to allow you  to run
RCLSTG  (requires  the  restricted   state)  in  batch.    This  allows
scheduling   of  RCLSTG   using  the   Job  Scheduler   or  the  SBMJOB
SCDDATE/SCDTIME function.   The RCLSTG2  command which  is a front  end
to  RCLSTG is  used as  it  provides a  better historical  view of  the
Reclaim Storage results.

Ensure  that  the RCLSTG  command  is set  for ALLOW(*ALL).    This may
require a change on your system.

The job  must  be  submitted to  a  job  queue  that will  run  in  the
controlling subsystem.

The user must  be authorized to the TAARCLSTG2 Authorization  List.  If
you  intend to  use RCLSTGBCH,  you should  consider making  the RCLSTG
command private  so  that users  such  as  QSYSOPR are  forced  to  use
RCLSTGBCH (or RCLSTG2).

A job log is always  output.  The TAA command DSPRCLHST may  be used to
review the past results.

Getting started
---------------

  **   You may want  to have a program such  as described for the EXIT1
       parameter  to inform  users that you  are going  to shutdown the
       system.  Assume your create this program as RCLSTGMSG.

  **   The RCLSTGBCH  command could  be entered with  a SBMJOB  command
       to run at  a specific time using the  SBMJOB SCDDATE and SCDTIME
       parameters.   You must ensure that the  job queue used is in the
       controlling subsystem.

             SBMJOB     JOB(RCLSTGBCH) CMD(RCLSTGBCH +
                          EXIT1(xxx/RCLSTGMSG)) +
                          SCDDATE(nnnnnn) SCDTIME(nnnnnn)


Controlling subsystem
---------------------

The RCLSTGBCH  function  will cause  the  controlling subsystem  to  be
started at completion.

Starting the controlling  subsystem causes the program  defined for the
QSTRUPPGM  system   value  to  be  run   which  normally  causes  other
subsystems to be started as if an IPL has occurred.

If you  have specified  POWERDOWN(*YES) on  RCLSTGBCH, the  power  down
function occurs after the reclaim function.

A900 0370 System Reference Code
-------------------------------

While running in  the restricted state  caused by a batch  program, the
system will set the System Reference Code to A900 0370.

If  the restricted  state lasts for  more than  the specified  time for
RSDTIMLMT  value  (default  is  360  minutes),  the  system  starts the
controlling subsystem.

Handling of error conditions
----------------------------

If  an  error  occurs,  the  STRSBS  command  is  used   to  start  the
controlling subsystem.  STRSBS may fail with two typical conditions:

  **   CPF1099 Attempting  to end.   A prior  request has been  made to
       end  the  subsystem.   This  could  occur if  the  system cannot
       reach the  restricted  state and  is  still  trying to  end  the
       controlling subsystem when STRSBS is used.

  **   CPF1010 Already started.

In  both cases,  the  job  waits 2  minutes  and  re-tries the  command
again.   After 5 retries  (or if an unexpected  STRSBS error occurred),
PWRDWNSYS *IMMED with RESTART(*YES) is used.

The intent is to  either complete the function  normally or ensure  the
system has been re-IPLed.

RCLSTGBCH escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

RCLSTGBCH steps
---------------

The command  would  typically be  submitted to  batch by  either a  job
scheduling function or the time delay of SBMJOB (or DLYSBMJOB).

  **   A job log is forced by specifying CHGJOB LOG(4 0 *SECLVL).

  **   The named Exit programs are checked for existence.

  **   The  parameters of  RCLSTGBCH are  sent as  messages to  the job
       log.

  **   If an Exit 1 program is specified, it is called.

  **   ENDSBS  is used to enter the  restricted state.  The command run
       is:

                ENDSBS SBS(*ALL) OPTION(*IMMED) +
                         DELAY(300) BCHTIMLMT(nnn)

       where  the  BCHTIMLMT value  from  the  RSDTIMLMT  parameter  is
       used.

       The  *IMMED  option  will  cause  the system  to  end  any  jobs
       immediately.   The  job waits 5  minutes before  checking to see
       if the restricted state has been reached.

       If the restricted state has  not been reached, the job waits  60
       seconds and tries  again.  This loop continues  until either the
       restricted  state is  achieved or the  RSDMIN limit  is reached.
       If the limit  is reached,  WRKACTJOB is  used to  list the  jobs
       which  cannot be  terminated  (along  with the  RCLSTGBCH  batch
       job), the  controlling subsystem is restarted, and  the job ends
       abnormally.

  **   If  the restricted  state is  reached and  an Exit 2  program is
       specified, it is called.

  **   RCLSTG2 is used which invokes RCLSTG.

  **   If POWERDOWN(*YES)  is  specified, PWRDWNSYS  is used  with  the
       RESTART parameter specified on RCLSTGBCH.

  **   If POWERDOWN(*NO)  is specified, the  STRSBS command is  used to
       start  the  controlling subsystem.    If  an Exit  3  program is
       specified, it is called.

RCLSTGBCH Command parameters                          *CMD
----------------------------

   SELECT        What reclaim  functions  to select.   The  default  is
                 *ALL.

                 *QDBXREF  may  be  specified  to  rebuild  the  system
                 internal cross reference files.

                 *DIR  may be specified  to rebuild  only the directory
                 portion.

   OMIT          What reclaim  functions  to  omit.    The  default  is
                 *NONE.

                 *QDBXREF may  be specified to  omit the  rebuilding of
                 the system internal cross reference files.

                 *DIR  may be  specified  to  omit the  rebuild  of the
                 directory function.

   ASPDEV        The  ASP  device or  group.   *SYSBAS is  the default.
                 This describes system ASP and ASPs 2-32.

                 A specific ASP device or group may be named.

   RSDMIN        The number  of minutes to  wait before the  restricted
                 state is  achieved.  15  minutes is the default.   999
                 minutes is the maximum.

                 The  RCLSTGBCH command  begins by requesting  that all
                 subsystems be ended with the command:

                     ENDSBS SBS(*ALL) OPTION(*IMMED) +
                              BCHTIMLMT(xxx)

                 The  system  performs  an  immediate  cancel  of   any
                 active jobs (other than the RCLSTGBCH job).

                 If  the restricted  state cannot  be  achieved in  the
                 number  of  minutes specified,  WRKACTJOB  is  used to
                 produce  a  listing  of  the  jobs  which  are   still
                 active,  the  RCLSTGBCH command  ends  abnormally  and
                 the controlling subsystem is restarted.

   RSDTIMLMT     The  number of minutes  the system  can remain  in the
                 restricted  state.    360 (6  hours)  is  the default.
                 The value must be between 30 and 999.

                 If  the  value  is  exceeded,  the  system   ends  the
                 RCLSTGBCH  function   and  restarts   the  controlling
                 subsystem.

                 If  the reclaim  operation  completes before  the time
                 limit, the  controlling  subsystem  is  started  which
                 ends the restricted state.

                 If  you  do  not  know the  approximate  time  that  a
                 reclaim  will  take,  use  the  ESTIMATE parameter  on
                 RCLSTG.   This will  give you  an approximation  which
                 will assist you  in determining the number  of minutes
                 to specify for RSDTIMLMT.

   POWERDOWN     A  *YES/*NO  option for  whether  the  system will  be
                 powered down after the RCLSTG is performed.

                 *NO  is the default.   The controlling subsystem would
                 be  restarted when  the  job running  SAVSYSBCH  ends.
                 This causes  the program  specified for  the QSTRUPPGM
                 system value to be run.

                 *YES  may be specified to power  down the system.  See
                 also the  RESTART parameter.   If  *YES is  specified,
                 the power down occurs after the EXIT3 option.

   RESTART       A *YES/*NO  option for  whether the  system should  be
                 restarted after a powerdown.

                 *NO is the default.

                 *YES  may  be specified  to restart  the  system after
                 the powerdown if  POWERDOWN(*YES) is  specified.   The
                 function runs by using PWRDWNSYS RESTART(*YES).

   EXIT1         An  optional program  to be  called  before ENDSBS  is
                 used to  enter the restricted  state.  If  the library
                 qualifier   is  blank,  *LIBL  is  used  to  find  the
                 program.

                 The intent of  this parameter is  to allow a  function
                 such  as  sending  messages  to any  interactive  jobs
                 stating  that  the system  is shutting  down  and that
                 jobs will be  cancelled.  A  good command to  consider
                 is SNDBRKACT such as:

                              /* Send RCLSTG message program */
                              PGM
                      TAATOOL/SNDBRKACT MSG('Please signoff.  We +
                                          are shutting down for +
                                          RCLSTG in 5 minutes.')
                              DLYJOB      DLY(300)
                              ENDPGM

   EXIT2         An   optional  program   to   be   called  after   the
                 restricted  state is  reached  and before  the reclaim
                 function begins.  If  the library qualifier is  blank,
                 *LIBL is used to find the program.

   EXIT3         An optional  program to  be called  after the  reclaim
                 function  is   completed  and  before   the  POWERDOWN
                 option  is  checked.    If  the  library  qualifier is
                 blank, *LIBL is used to find the program.

                 If    the    job    running     RCLSTGBCH    specifies
                 POWERDOWN(*NO),  the  system  starts  the  controlling
                 subsystem  when  the  job  ends.    This  invokes  the
                 program  in  the   QSTRUPPGM  system   value.     This
                 normally starts various  system jobs as if  an IPL had
                 occurred.


Restrictions
------------

You must be authorized to the TAARCLSTG2 *AUTL to use RCLSTGBCH.

The  job  must  be submitted  to  a  job queue  that  will  run in  the
controlling subsystem.

Prerequisites
-------------

The following TAA Tools must be on your system:

     CHKRSDSTE       Check restricted state
     CHKTAAOWN       Check TAA owner
     EDTVAR          Edit variable
     RCLSTG2         Reclaim storage 2
     RSNLSTMSG       Resend last message
     RTVIPLSTS       Retrieve IPL status
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   RCLSTGBCH     *CMD                   TAARCLB       QATTCMD
   TAARCLBC      *PGM       CLP         TAARCLBC      QATTCL
					

Added to TAA Productivity tools October 15, 2009


Home Page Up to Top