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

# GENLOG.PUB

GENLOG.PUB is a public program that performs several functions related to user logging. It’s key function is to write new entries to the user log (OSLG) file.

TEMPLATE_INIT:

This entry point sets up the OSLG template, which is used throughout the user log processes.

`1005 TEMPLATE_INIT:`
`1001 ENTER OSLG$`

Variable | Description
OSLG$ | Template for data file OSLG

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

This chart breaks down the OSLG$ template. All values are set by the WRITE_NEW_LOG call point, unless noted that the variable can be set by the calling program.

Field | Description
USRID:C(12*) | STBL("USERID")
SYSDATE:N(7*) | Current system date
TIME:C(8*) | Current system time
TERMID:C(4*) | Current terminal ID
APP:C(2*) | STBL("MENUAPP"); May be set by calling program
MENU:C(40*) | STBL("MENUDESC"); May be set by calling program
LIVE:N(1*) | 0=Sample data, 1=Live data
CID:C(3*) | STBL("CID"); May be set by calling program
WKSDATE:N(7*) | STBL("JULDATE") (current workstation date)
CODECOMP:C(3*) | STBL("CID")
CODECODE:C(12*) | STBL("ACCESSCODE")
CODENAME:C(12*) | STBL("ACCESSNAME")
CODEMENU:C(1*) | STBL("MITEM"); May be set by calling program
MENUNAME:C(50*) | STBL("MPROG"); May be set by calling program
CODEPARM:C(2*) | STBL("MPARAM"); May be set by calling program
MENUREC:C(12*) | Not used
MENUFILE:C(12*) | Not used
EXITDATE:N(7*) | Sets to system date when exiting a function
EXITTIME:C(8*) | Sets to system time when exiting a function
APPYEAR:N(4*) | If calling program is PA/DD/GL, sets to current year of that application
RSV1:C(1*) | Reserved for OSD
RSV2:C(1*) | Reserved for OSD
RSV3:C(1*) | Reserved for OSD
RSV4:C(1*) | Reserved for OSD
ISVA:C(1*) | Reserved for ISV
ISVN[2]:N(1*) | Reserved for ISV

WRITE_NEW_LOG:

This entry point is used to write new entries to the log file. It is called by the menu programs before the user is taken to the function they chose to run. A global variable is set that contains the key to the record so that the exit time can be recorded once the user leaves the function. This is kept in STBL(“LOGENTRY”).

`2005 WRITE_NEW_LOG:`
`2010 ENTER OSLG$,FILE[ALL]`

Variable | Description
OSLG$ | Template for data file OSLG
FILE[ALL] | Standard file array

WRITE_TIMEOUT_LOG:

This entry point is used to write the current system date and time to the exit fields in the OSLG file, given a specific key in the file contained in STBL("LOGENTRY").

`2205 WRITE_NEW_LOG:`
`2210 ENTER OSLG$,FILE[ALL]`

Variable | Description
OSLG$ | Template for data file OSLG
FILE[ALL] | Standard file array

STARTING_STOPPING_OSAS:

This entry point is used to record when a user started and exited OSAS. The starting entry record is saved in STBL("LOGENTRYSTARTOSAS"), and if set, when this function is called, it’s assuming that the user is exiting OSAS.

`2305 STARTING_STOPPING_OSAS:`
`2310 ENTER OSLG$,FILE[ALL]`

Variable | Description
OSLG$ | Template for data file OSLG
FILE[ALL] | Standard file array