Using the PROCEDURE field in an Advantage CA-Ramis Profile

Document ID : KB000055824
Last Modified Date : 14/02/2018
Show Technical Document Details

This article is intended to give you an overview and a simple example of using the PROCEDURE field in an Advantage CA-Ramis PROFILE named RAMIS. There may be times when you would like to control what a user sees or has access to when they initially enter an Advantage CA-Ramis session. Perhaps there is general information you would like to have displayed at the beginning of every session, regardless of the user or type of Advantage CA-Ramis application, or maybe you have a "front-end" application you would like all users to pass through. By using the PROCEDURE field in the default PROFILE named RAMIS, all this can be done automatically.

First, let's take a look at an Advantage CA-Ramis PROFILE. A PROFILE is a stored set of parameter values for the fields in the RAMSET file. These parameters are used to provide environment and session control within an Advantage CA-Ramis session or application. Values for the RAMSET fields may also be modified during an Advantage CA-Ramis activity by using the SET command. The QUERY SET command will display the current values for the most common fields in the RAMSET file. The table below contains a RAMINDEX display of the fields in the system file RAMSET.

Unlike the other fields in the RAMSET file, the PROCEDURE field of the PROFILE is only executed if the PROFILE name is RAMIS. If the PROFILE name is NOT RAMIS, the PROCEDURE field is ignored. The PROCEDURE field may contain the name of either an SBX procedure or an EXECUTIVE procedure. However, the PROCEDURE field in RAMSET is defined as an alphanumeric field with a length of only 8 positions. In RAMSBX, the procedure NAME field has a length of 32, and in RAMEXECS the PROCEDURE field has a length of 12. When building a procedure to be automatically executed from within a RAMIS profile, it is important to keep the name to 8 characters or less.

The procedure specified in a PROFILE named RAMIS will be automatically executed when the Advantage CA-Ramis session initiates. The procedure will NOT be executed any other time. That means when a user enters Advantage CA-Ramis with a CLIST in the TSO environment, or through a CMS EXEC or a CICS transaction, or even through batch initiation, a procedure named in the PROCEDURE field of the RAMSET PROFILE named RAMIS will be automatically executed.

What can we do with the automatically executed PROCEDURE? Well, just about anything. While you may not pass parameters to the procedure at execution, you may have the procedure prompt for parameters, and you may use variables. The procedure may execute other SBX or Executive procedures, invoke FSM (Formatted Screen Manager) formats, or even invoke MENU applications built by Advantage CA-Ramis Menu Expert. A very simple procedure may be:

PRINT TODAY IS &%DATE;         
PRINT &%TIME;                  
PRINT ACTIVE USER IS &%USERID;
PRINT ACTIVE LIBRARY DATABASE IS &%PROCLIBE;
PRINT CALLING THE RAMIS MENU BASED ARCHITECTURE START UP MENU;
EXEC RMBA;
EXIT;

This procedure can be compiled and saved with the name STARTAPP by using the following syntax:

SBXLOAD STARTAPP SOURCE LINE                      
PRINT TODAY IS &%DATE;         
PRINT &%TIME;                  
PRINT ACTIVE USER IS &%USERID;
PRINT ACTIVE LIBRARY DATABASE IS &%PROCLIBE;
PRINT CALLING THE RAMIS MENU BASED ARCHITECTURE START UP MENU;
EXEC RMBA;
EXIT;
END SBXLOAD
COMPILE STARTAPP END

When this procedure is executed, the results will be:

After pressing the ENTER key, the following screen, the Main Menu for RMBA, will be displayed:

The final step to having a procedure execute automatically at any session initiation is to update the RAMSET file to include the procedure name in the PROFILE RAMIS. The following syntax will modify the existing profile named RAMIS by adding the name STARTAPP to the PROCEDURE field.

 UPDATE
 FILE RAMSET
 PROFILE=RAMIS,PROCEDURE=SET=STARTAPP,$  
 END

The updated PROFILE named RAMIS, as well as any other procedures being called from the procedure named in RAMSET, must be available in either the primary database or a library database at the time Advantage CA-Ramis is invoked.

Read More About It

For more information about executing automatic procedures, refer to the publication Advantage CA-Ramis Syntax-Based Reporting. Additional information about SBX procedures can be found in the publication Advantage CA-Ramis System Building Executive (SBX). Information about PROFILEs can be found in the publication Advantage CA-Ramis Utilities.

Contribute Your Ideas

If you have a tried and true technique that you would like to share with the Advantage CA-Ramis community as a published article, please contact Computer Associates Support.