Site user module

The Site User Module is called by Peek at the beginning and end of every Peek session. It is used to set site parameters that Peek needs to operate correctly. Additionally, it can be used to issue terminal commands that may enhance Peek's usability.

The screen below shows PKINSTAL after selecting option 1. It asks for many parameters that will be used to generate the PKUSRN01 module.

PKUSRN01

Each of the input fields has a help routine associated with it. Enter a question mark in any field to view the help screen.

audit

Below is an example of the code generated by PKINSTAL after completing the screen shown above. Once the program has been generated and STOWed, it can be modified to add functionality. See the code at the bottom for examples of some terminal commands that might be issued.

0010 * ----------------------------------------------------------------------
0020 * This module is used to set any site-specific parameters for the
0030 * usage of PEEK.  It will be executed twice during every user's session,
0040 * once at the beginning of the session, and again at the end of the
0050 * session.  This way any actions that were taken during the first call
0060 * can be 'undone' by the second.  For example, the window framing
0070 * commands can be executed on entry, and then reset to the default
0080 * on exit.
0090 * ----------------------------------------------------------------------
0100 * Copyright (C) Denis Molony 1990-2005 - All rights reserved
0110 * ----------------------------------------------------------------------
0120 *
0130 DEFINE DATA
0140 PARAMETER
0150   1 #ACTION                        (A1)
0160   1 #CALLING-MODULE                (A8)
0170   1 #SECURITY-ROUTINE              (A8)
0180   1 #USING-ADABAS-SECURITY         (L)
0190   1 #USER-ENVIRONMENT-ID           (A1)
0200   1 #SET-N-SUPPORTED               (L)
0210   1 #MAX-PE-SIZE                   (P3)
0220   1 #ADABAS-VERSION                (I1/3)
0230 *
0240   1 #FDIC-DB                       (B2)
0250   1 #FSEC-DB                       (B2)
0260   1 #FUSER-DB                      (B2)
0270   1 #FNAT-DB                       (B2)
0280 *
0290   1 #FDIC-FN                       (B2)
0300   1 #FSEC-FN                       (B2)
0310   1 #FUSER-FN                      (B2)
0320   1 #FNAT-FN                       (B2)
0330 *
0340   1 #PEEK-FILE-NO                  (B2)
0350   1 #PEEK-FILE-DB                  (B2)
0360   1 #PEEK-USER-ID                  (A8)
0370 *
0380   1 #USER-CODE                     (P7)
0390   1 #INVALID-BYTES                 (B1/10)
0400 *
0410   1 #ADD-ALLOWED                   (L)
0420   1 #MOD-ALLOWED                   (L)
0430   1 #DEL-ALLOWED                   (L)
0440   1 #AUDIT-LEVEL                   (P3)
0450   1 #LIBRARY-CHANGE-ALLOWED        (L)
0460 *
0470   1 #INSTALLED-LANGUAGES           (I1/5)
0480   1 #FAQ-LEVEL                     (I1)
0490   1 #UDB-LEVEL                     (I1)
0500 *
0510 LOCAL
0520   1 #STACK                         (A20)
0530 END-DEFINE
0540 *
0550 * ----------------------------------------------------------------------
0560 * Note about available SAG modules:
0570 * -----------------------------------
0580 * In the event of a NATURAL or ADABAS error, PEEK will attempt to call
0590 * the subprogram USR0020N, which can be found in library SYSEXT (in
0600 * FNAT). This module returns the error text for a specified error
0610 * number. To make it available, it should be copied to the SYSTEM
0620 * library (in FUSER).
0630 *
0640 * If a security routine is specified (see below), then PEEK will call
0650 * the subprograms NSC---L (to check the security link between the user
0660 * and the nominated library), and NSCLI (to check whether update modules
0670 * are permitted). These modules should also be copied to SYSTEM.
0680 * ----------------------------------------------------------------------
0690 *
0700 DECIDE ON FIRST VALUE OF #ACTION
0710 VALUE 'E'                              /* Entering PEEK
0720 *
0730 * ----------------------------------------------------------------------
0740 * If using PEEK's save feature and a file has been created, then set
0750 * the following fields to the ADABAS file number and database of the
0760 * preferences file. It is recommended that the DB field be left as
0770 * zero, unless you are using the UDB or TF parameter and do not wish to
0780 * define a separate preferences file on each database.
0790 *
0800 * To use this feature you MUST create an FDT with the following
0810 * fields:
0820 *        AA, A49,  Descriptor, Null suppressed
0830 *        AB, A253,             Null suppressed, MU field
0840 *
0850 * Note that it is not necessary to generate a DDM.
0860 * If not using a preferences file, set the value to zero.
0870 * ----------------------------------------------------------------------
0880 *
0890   #PEEK-FILE-NO := 25
0900   #PEEK-FILE-DB := 0
0910   #PEEK-USER-ID := *USER
0920 *
0930 * ----------------------------------------------------------------------
0940 * Set the environment ID. This is a one byte value that the site may
0950 * use to store separate environment data on a single (shared) PEEK
0960 * preferences file. If the preferences file is not shared, set the
0970 * value to any constant.
0980 * If the site shares the preferences file between several environments,
0990 * this module must be able to identify the user's current environment
1000 * and set this value accordingly.
1010 *
1020   #USER-ENVIRONMENT-ID := 'X'
1030   #USER-CODE           := 0            /* Only used for demos
1040 *
1050 * ----------------------------------------------------------------------
1060 * Choose which security routine to use:
1070 *
1080 *   1) the PEEK-provided 'PKSECN01'
1090 *   2) a site-provided module
1100 *   3) no security (leave #SECURITY-ROUTINE blank)
1110 *
1120 * If using option #2, the calling parameters are as follows:
1130 *
1140 *    --->  #FSEC-FN          (B2)
1150 *    --->  #FSEC-DB          (B2)
1160 *    --->  #DDM-NAME         (A32)
1170 *    --->  #LIBRARY-NAME     (A8)
1180 *    <---  #FILE-MODIFIABLE  (L)    Whether the file may be updated
1190 *    <---  #SECURITY-STATUS  (P3)   0 = success, non-zero = failure
1200 *
1210   #SECURITY-ROUTINE := ' '
1220 *
1230 * ----------------------------------------------------------------------
1240 * Set the ADABAS SECURITY parameter
1250 *
1260 * If any of your files are protected by ADABAS SECURITY, you must
1270 * specify #USING-ADABAS-SECURITY = TRUE. Also, you will need to
1280 * modify the module PKPSWN01. This module allows you to specify the
1290 * password for each protected file.
1300 *
1310 * The parameters for this module are:
1320 *
1330 *    --->  #REQ-FILE-NO      (B2)
1340 *    --->  #REQ-DATABASE     (B2)
1350 *    <---  #ADABAS-PASSWORD  (A8)
1360 *    <---  #ADABAS-CIPHER    (A8)
1370 *
1380   #USING-ADABAS-SECURITY := FALSE
1390 *
1400 * ----------------------------------------------------------------------
1410 * Specify whether the user may Add/Modify/Delete data.
1420 *
1430   #ADD-ALLOWED := TRUE             /* Same for COPY
1440   #MOD-ALLOWED := TRUE
1450   #DEL-ALLOWED := TRUE
1460 *
1470 * ----------------------------------------------------------------------
1480 * If the user is allowed to specify an alternative library on the FILE
1490 * screen, then set the following field to TRUE. If it is set to FALSE
1500 * then the LIBRARY field will be completely suppressed.
1510 *
1520   #LIBRARY-CHANGE-ALLOWED := TRUE
1530 *
1540 * ----------------------------------------------------------------------
1550 * If you wish to record any audit trail information, set the audit
1560 * level here. The options are:
1570 *
1580 *    0 = No audit logging
1590 *    1 = Module PKADTN01 called once per transaction (after the
1600 *        update)
1610 *    2 = Module PKADTN01 called twice per transaction (once before
1620 *        and again after the update)
1630 *
1640   #AUDIT-LEVEL := 0
1650 *
1660 * ----------------------------------------------------------------------
1670 * Set the current Adabas version number. Peek will use this value to
1680 * determine which Adabas features are currently available.
1690 *
1700   #ADABAS-VERSION (1) := 5        /* Version number
1710   #ADABAS-VERSION (2) := 4        /* Release
1720   #ADABAS-VERSION (3) := 4        /* SM level
1730 *
1740 * ----------------------------------------------------------------------
1750 * Specify whether the user is permitted to view the UDB setting.
1760 * Possible values are:
1770 *   0 = UDB feature unavailable
1780 *   1 = UDB value may be queried
1790 *   2 = UDB value may be set to any value
1800 *   3 = UDB value may be set, subject to site security
1810 *
1820   #UDB-LEVEL := 0
1830 *
1840 * ----------------------------------------------------------------------
1850 * Set the FAQ level. The following are the possible values:
1860 *     1 - Only use the Peek FAQ (default)
1870 *     2 - Use Peek's FAQ followed by the site's FAQ
1880 *     3 - Use the site's FAQ followed by Peek's FAQ
1890 *     4 - Only use the site's FAQ
1900 *
1910   #FAQ-LEVEL := 1
1920 *
1930 * ----------------------------------------------------------------------
1940 * Different versions of ADABAS allow either 99 or 191 occurrences
1950 * for a Periodic Group field. Specify which value is supported
1960 * in this environment.
1970 *
1980   #MAX-PE-SIZE := 99
1990 *
2000 * ----------------------------------------------------------------------
2010 * Specify whether the SET CONTROL 'N' statement is supported in this
2020 * environment.
2030 *
2040   #SET-N-SUPPORTED := TRUE
2050 *
2060 * ----------------------------------------------------------------------
2070 * Specify whether fields are to be displayed in LDA sequence. Note that
2080 * using this option will preclude the use of the 'User-DDM' function,
2090 * as this method replaces it.
2100 *
2110 *
2120 * ----------------------------------------------------------------------
2130 * Specify any byte values that will cause the screen display to be
2140 * scrambled. PEEK will substitute H'FF' for any values specified here.
2150 *
2160 * #INVALID-BYTES (1) := H'27'      /* For example...
2170 *
2180 * ----------------------------------------------------------------------
2190 * Provide information about which language(s) PEEK should allow. The
2200 * value specified at occurrence (1) will be the start-up language, and
2210 * any subsequent languages specified will allow the user to switch
2220 * between them.
2230 *
2240   #INSTALLED-LANGUAGES (1) := 1      /* English
2250   #INSTALLED-LANGUAGES (2) := 3      /* French (optional)
2260 *
2270 * ----------------------------------------------------------------------
2280 * PEEK needs to know the file and database numbers of the system files.
2290 * You may either set them here, or leave them blank and a later
2300 * module will set them.
2310 *
2320 * #FDIC-FN  := 0
2330 * #FDIC-DB  := 0
2340 *
2350 * #FSEC-FN  := 0
2360 * #FSEC-DB  := 0
2370 *
2380 * #FUSER-FN := 0
2390 * #FUSER-DB := 0
2400 *
2410 * #FNAT-FN  := 0
2420 * #FNAT-DB  := 0
2430 *
2440 * ----------------------------------------------------------------------
2450 * Perform any site-related action on entry.
2460 *
2470   SET CONTROL 'D=BW'         /* Window highlight off
2480   SET CONTROL 'F=+-|'        /* Frame characters
2490   SET CONTROL 'WF'           /* Automatic window framing on
2500   SET CONTROL 'T+'           /* Allow cursor to move freely
2510   SET CONTROL 'L'            /* Allow lower case data entry
2520   SET CONTROL 'MT'           /* Message line to top of screen
2530   SET CONTROL 'YB'           /* PF keys to bottom of screen
2540   SET CONTROL 'Y=GRGR'       /* PF keys coloured green
2550   SET CONTROL 'YF'           /* Show PF1-12
2560 *
2570 * ----------------------------------------------------------------------
2580 *
2590 VALUE 'L'                    /* Leaving PEEK
2600 *
2610 * Perform any site-related action on exit.
2620 *
2630   SET CONTROL 'D=BW'         /* Window highlight on
2640   SET CONTROL 'F=   '        /* Reset frame characters
2650   SET CONTROL 'MT'           /* Message line to top of screen
2660   SET CONTROL 'U'            /* Force uppercase
2670 *
2680 * Check whether we are going to another PEEK component
2690 *
2700 * IF *DATA LT 0
2710 *   SET CONTROL '.S'
2720 *   INPUT #STACK
2730 *   IF SUBSTRING (#STACK, 1, 4) NE H'12C54040'     /* Check for editor
2740 *     WRITE 'Stack command :' #STACK
2750 *   END-IF
2760 * END-IF
2770 *
2780 NONE
2790   IGNORE
2800 END-DECIDE
2810 *
2820 END