You are here: Development Standards > Routines > General Routines > GENCODE.PUB

# GENCODE.PUB

GENCODE.PUB is a public program that verifies access to a particular program or menu for the current user. Use this program in file maintenance programs called by GENMAINT.PUB, and in other programs where access checking is needed.

(Normal Entry Point)

This entry point will perform the access code check for a particular user.

`0060 ENTER CODETPL$,OSUR$,OSCODE$,FILE[ALL]`

Variable | Description
CODETPL$ | String template used for access checking
OSUR$ | String template for OSUR file
OSCODE$ | String template for OSCODE file
FILE[ALL] | Standard file array

Exit Points | Explanation
EXIT | GENCODE.PUB does not return any errors.

This chart breaks down the CODETPL$ template:

Field | Description
TYPE:C(1*) | Defines the type of entity in NAME$: "1" - menu file "2" - menu record “3” - RUN program "4" - CALLed program "5" - SCALLed program "6" - CALLed information window program
NAME:C(50*) | Program, menu file or menu record as defined by TYPE$.
PARAM:C(12*) | Parameter passed to a program, or the menu file if TYPE$ is 2, a menu record.
ACCESS:N(1*) | Set to 1 if access is granted. Set to 0 if access is denied.
USER:C(12*) | Current user ID to check. If blank, STBL("USERID") is checked for access.
ROLE:C(12*) | Current role IDs to check. If blank, all user roles for current user is built and checked.
APP:C(2*) | Specific Application ID to check for access in. If blank, first two letters of CODETPL.NAME$ is used.
OSCODECH:N(1*) | FILE[x] element that OSCODE channel is opened on. If 0, OSCODE is opened in GENCODE.PUB.
OSURCH:N(1*) | FILE[x] element that OSUR channel is opened on. If 0, OSUR is opened in GENCODE.PUB.
SKIPCOMP:N(1*) | Not used in GENCODE.PUB
EIS:N(1*) | Set to 1 if EIS is calling GENCODE.PUB. Otherwise, set to 0.

GET_TEMPLATE

This entry point will set the template CODETPL$.

`4010 GET_TEMPLATE:`
`4020 ENTER CODETPL$`