Initialization with the default system initialization procedure

The name of the default procedure in QMF is Q.SYSTEM_INI. The Q.SYSTEM_INI procedure can run any QMF command or any stored query that the user is authorized to run before the home panel displays.

About this task

The Q.SYSTEM_INI procedure runs just after QMF initialization completes and before the QMF initial procedure specified by the DSQSRUN program parameter is run. Thus, if you have session controls in the procedure that is specified by the DSQSRUN parameter, consider moving them to the Q.SYSTEM_INI procedure. All of the QMF functions available to QMF procedures are also available for use by the Q.SYSTEM_INI procedure.

This sample Q.SYSTEM_INI procedure is provided with QMF and makes SHARE=YES the default for all QMF objects that are saved in the database:

Figure 1. The Q.SYSTEM_INI procedure that is shipped with QMF
--  Q M F    S Y S T E M    I N I T I A L I Z A T I O N    P R O C  
--  -----    -----------    ---------------------------    -------  
--                                                                  
--  FUNCTION: PROVIDE AN EXAMPLE QMF SYSTEM INITIALIZATION PROCEDURE
--            THAT CAN BE ADDED AFTER QMF INSTALLATION. YOU MAY MOD-
--            IFY OR REPLACE THIS PROCEDURE WITH YOUR OWN VERSION.  
--                                                                  
--            THE PROCEDURE MUST BE STORED IN THE DATABASE UNDER THE
--            NAME OF Q.SYSTEM_INI BEFORE IT WILL RUN AUTOMATICALLY.
--                    ------------                                  
--                                                                  
--  THE COMMAND BELOW IS AN EXAMPLE OF ESTABLISHING A NEW DEFAULT   
--  FOR THE SHARE OPTION OF THE SAVE COMMAND THAT WILL APPLY TO ALL 
--  QMF USERS. (REMOVE THE LEADING COMMENT SYMBOLS "--" TO ACTIVATE 
--  IT.)                                                            
--                                                                  
-- SET GLOBAL (DSQEC_SHARE=1  -- MAKE SHARE=YES THE DEFAULT FOR ALL

The Q.SYSTEM_INI procedure, as well as any object used or called by this procedure, has the same security as any other QMF object or database object during a QMF session. The Q.SYSTEM_INI procedure is a normal QMF procedure, except for the fact that QMF tries to run it each time a QMF session is started. Thus, to run the procedure successfully, QMF must be started under an authorization ID that has QMF administrator authority.

If the Q.SYSTEM_INI procedure exists but is restricted (not shared), the result is the same as with any other QMF procedure object. If the procedure does not exist, QMF does not attempt to run it.

Procedure

To use the default system initialization procedure, complete these steps:

  1. Install the procedure.
    The sample procedure that is shipped with QMF is called DSQ0BINI. It can be found in QMF1310.SDSQSAPE(DSQ0BINI).
    • If you installed QMF Version 13.1 into a database that contains a prior QMF release, issue the following command from within QMF to check for an existing system initialization procedure before you install the sample. Be sure that you are connected to the database under a QMF user ID with administrator authority.
      DISPLAY Q.SYSTEM_INI
    • If you already have a system initialization procedure and want to overwrite it with the sample, or do not have one and want to install the sample, continue with the following command:
      IMPORT PROC FROM ’QMF1310.SDSQSAPE(DSQ0BINI)’
  2. Save the procedure under the name Q.SYSTEM_INI in the database in which it will run.
    Before the default system initialization procedure can run automatically, you must save the procedure with the name Q.SYSTEM_INI. Share the procedure with all QMF users.
    1. You can share the procedure by displaying it in QMF and then issuing the command SAVE PROC (SHARE=YES.
    2. Add a comment that describes the procedure when you save it.
      For example:
      SAVE PROC AS Q.SYSTEM_INI (SHARE=YES,COMMENT='QMF System Initialization Procedure')

What to do next

To troubleshoot problems with the Q.SYSTEM_INI procedure, you can use the QMF L2 tracing option to see commands and messages issued.

The Q.SYSTEM_INI procedure cannot be replaced by other procedures, but it can call other procedures. If the default system initialization procedure does not meet your site's needs, you can create your own version