[?29h[0"z UIF310 User Interface Screen Handler Purpose: This subprogram displays menus from the Master File to the users and accepts the options selected. If the option selected is a transaction, the subprogram validates it against the Secur- ity File to see if it is valid for the user, and calls the Trans- action Processor. Options: None. Logic: Calling Sequence: CALL "UIF310" USING MASTER-RECORD, USER-RECORD, EXIT-SW. where: MASTER-RECORD - is in the CDD under UIF_MASTER_RECORD and con- MASTER-RECORD tains menu and/or transaction information. WS-USER-RECORD - is PIC X(21) and contains the top level menu WS-USER-RECORD name and the generic username. EXIT-SW - is a switch PIC X(01) with the following values: EXIT-SW NOT-DONE - "N"; TOP-LEVEL-MENU - "T"; FIRST-TIME - "F"; DONE - "Y". SUBROUTINE-RETURN-STATUS - is PIC S9(09) COMP. This variable SUBROUTINE-RETURN-STATUS is the VMS System completion status of UIF310. UIF310 is called by UIF300 and by itself. Since it is recur- sive, and it does not contain the INITIAL clause, it passes data to itself in memory. This is intentional and proper execution depends upon this property. When called, the program checks to see if it is the first call or a subsequent one. If it is the first call, it initializes its control switches; otherwise, it preserves them. It then increments the stack pointer, and checks to see if it has exceeded the maximum of 20 (by design). If it has, it issues a fatal error and exits; otherwise, it pushes the current menu name passed to it onto the stack. The program then checks to see if it was passed a transaction instead of a menu. Revised: 15-Feb-85 Page 1  If so, it bypasses the normal menu processing and goes directly to the code which calls the transaction processor. Normally, however, it opens the Master File and performs TDMS initializa- tion functions. It then sets up the menu which will be displayed to the user, and does so. The program then validates the user's choice as follows: 1. Tests for a numeric entry. 2. Tests for a control character. 3. Reads the Security File to see if it is a valid transac- tion for this user. If none of the above are true, the user is issued an error mes- sage asking him to reenter a valid choice. If the choice was numeric, an additional test is made to see whether or not it is a transaction. If not, the program reads the master file for the appropriate menu and sets up to call and calls itself. If it is a transaction, the program performs the test in 3) above and proceeds accordingly. If a control character was chosen, the program sets the appro- priate switch and returns to the previous level of recursion. Upon returning, the switches are tested again and further returns are made if the user selected either return to top level menu or exit, until the program returns to UIF300. If the selection was go back to the previous menu, upon return, the stack pointer is decremented and the switch is reset, at which point the routine branches back to the create and display menu. If a transaction was chosen, it sets up a call to the Transac- tion Processor and executes it. The Transaction Processor runs the user's request and then returns to the program with a comple- tion status for both itself and the request executed for the user. An error in the Transaction Processor will cause an appro- priate error message to be displayed on the screen. Control then branches to display the menu that the user was in when the trans- action was chosen. Subprograms: 1. UIF320: Transaction Processor. Calling Sequence: CALL "UIF320" USING MASTER-RECORD-NAME, SUBPROCESS-RETURN-STATUS GIVING SUBROUTINE-RETURN-STATUS. where: Revised: 15-Feb-85 Page 2  MASTER-RECORD-NAME - is PIC X(09) is the transaction name for MASTER-RECORD-NAME the transaction to be executed. SUBPROCESS-RETURN-STATUS - is PIC S9(09) COMP and is the com- SUBPROCESS-RETURN-STATUS pletion status of the subprocess created by the Transaction Pro- cessor. SUBROUTINE-RETURN-STATUS - is PIC S9(09) COMP and is the SUBROUTINE-RETURN-STATUS VMS System completion status of the Transaction Processor. Files: File Id File Name Usage UIF340.MAS User Interface Master File Input UIF340.SEC User Interface Security File Input Display Messages: Message: "UIF310 - F - INTERNAL STACK OVERFLOW. CONTACT DP.". Response: UIF310 can call itself a maximum of twenty times(by de- sign). This limit has been exceeded. If this message appears, the user has gone through 20 menus, and you should change his menu tree. Message: "INVALID CHOICE. ENTER VALID CHOICE OR TRANSACTION. HIT TO CONTINUE." Response: The user has entered invalid data. Message: Symbol in .JOB not found in symbol table Response: A symbol was found in the input .JOB transaction file which was not put into the symbol table by the UIF request. Make sure that every symbol which appears in the .JOB is entered as a symbol name in the symbol table. The name has to match exactly. exactly Revised: 15-Feb-85 Page 3  Message: Illegal symbol type in symbol table (must be 9 or X) Response: A symbol type in the symbol table is other than 9 or X. At this time the only valid symbol type are 9 for numeric and X for alphanumeric. Make sure that each symbol name define in the symbol table by the request is one of these types. Message: XXXXXXXXX not implemented yet Response: A transaction was requested for which no transaction com- mand procedure has been defined. If you believe the com- mand procedure has been defined for this transaction, make sure your logical is set up correctly and that the tran- saction command procedure is indeed where you expect it to be. Message: Internal error in 520-SET-SWITCHES Response: This message should only appear during debugging. If it does appear it means that the paragraph was called with an incorrect value in MENU-CHAR(1). Revised: 15-Feb-85 Page 4