User session procedure example

The session procedure can call another procedure. The procedure being called can be a user procedure that is created, owned and updated by a QMF user. You can use the same named procedure for different users if each user has a unique SQLID. When each user starts QMF they are running under their own SQLID. That SQLID is the default object owner when the object owner is not otherwise specified when accessing a QMF object or database object. For example, the QMF session procedure Q.SYSTEM_INI, could set global variables or company wide global variables and then call a user session procedure. In the following example, the user session procedure is called USER_INI.

Figure 61. Q.SYSTEM_INI example that calls a user defined procedure
PROC                  Q.SYSTEM_INI                        LINE    1
 
-- This QMF procedure example shows how to setup  QMF session defaults for
-- every QMF user and then calls a user procedure called USER_INI that will set
-- individual QMF session defaults
--
   QMF SET GLOBAL (DSQEC_NLFCMD_LANG=1)   --  Process English Commands
   QMF RESET PROC                         --  Hide Contents of this PROC
   QMF SET PROFILE (WIDTH=80,LENGTH=66)   --  Set Default Report Page Size
   QMF SET PROFILE (SPACE=COMMON)         --  Set Default Space for Save Data Command
   QMF SET GLOBAL (DSQDC_LIST_ORDER=5D)   --  Object List Sorted by Date Modify
   QMF SET GLOBAL (DSQEC_RESET_RPT=1)     --  Prompt for Report Completion
   RUN USER_INI                           --  Run Users Session Procedure
   QMF END                                --  Display QMF Home screen first
   QMF SET GLOBAL (DSQEC_NLFCMD_LANG=0)   --  Return to Presiding Language
 
Figure 62. User session procedure example: user.USER_INI
PROC        WILLIAMS.USER_INI                      LINE
1
-- This QMF procedure example shows how to setup QMF session defaults for
-- a QMF user. The following settings replace any settings set by the
-- SYSTEM_INI proc.

--
   QMF SET GLOBAL (DSQEC_NLFCMD_LANG=1)  --  Process English Commands
   QMF RESET PROC                        --  Hide Contents of this PROC
   QMF SET PROFILE (SPACE=MYSPACE)       --  Store data in MYSPACE.
   QMF SET PROFILE (PRINTER=MYROOM)      --  Print reports at My Printer
   QMF SET GLOBAL (DSQDC_LIST_ORDER=3A)  --  Object List Sorted by Object Name
   QMF SET GLOBAL (DSQEC_RESET_RPT=2)    --  Always ResetReports
   QMF SET GLOBAL (DSQEC_SHARE = 1)      --  Always Share My QMF Objects
   QMF SET GLOBAL (DSQEC_NLFCMD_LANG=0)  --  Return to Presiding Language
[ Previous Page | Next Page | Contents | Index ]