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:
-- 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:
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