Language Constructs

Equation Editor uses the language constructs discussed in the following topics.

Keywords

Keyword usage is mostly self-explanatory. Complex keywords will be explained later in the context of their syntactical constructs. These are the keywords:

  • (

  • )

  • *

  • +

  • -

  • /

  • <

  • <=

  • <>

  • =

  • >

  • >=

  • And

  • Assign

  • Call

  • Call Parms

  • Choose

  • Delete

  • Else

  • Else If

  • End Assign

  • End Call Parms

  • End Delete

  • End Find

  • End If

  • End Insert

  • End Loop

  • End Message

  • End Restore

  • End Save

  • End Update

  • Exists

  • Exit Loop

  • Find First

  • Find Next

  • From

  • Halt

  • If

  • Insert

  • Into

  • Loop

  • Message

  • Not

  • Or

  • Restore

  • Return

  • Save

  • Set

  • Skip

  • Then

  • Trace

  • Update

  • Where

Global and Local Variables

Two types of variables are available in the Equation Engine: global and local. Data is passed to the Equation Engine by means of the global variable array or a process instance of the global variable tables that is defined by the Equation Test Data page or a calling program. Global variables are visible and can be referenced by any equation running or called. Local variables are visible only to the currently running equation.

Local and global variables can have a stem qualification. Stems are similar to arrays except that they have more versatility and are unbounded. You can assign a variable a name that ends with a period (.) to a default value (for example, DOGOWNER. = "unknown"), and then reference a subscript of that stem. If the subscript was not initialized with a value, then it will pick up the default value (for example, DOGOWNER.X has the value "unknown").

Stems are more versatile than arrays because the bounds of an array must be declared, but stems have no bounds to be declared and the subscripts do not have to be numeric. Therefore, you can have a subscript value of "Fido" instead of 7 (for example, Assign X = "Fido" and then Assign DOGOWNER.X = "Joe"). This construct not only allows a pseudo array processing capability, it also allows a pseudo pointer capability (for example, NODE.LEFT and NODE.RIGHT).

Read-only (system) variable names always begin with an exclamation mark.

Depending on which application is invoking the equation, different global variables may be assumed to be passed into the equation and different global variables (or none) are expected to be returned from the equation.

Global Variables Always Passed in for All Applications

The following global variables are always passed in:

  • !CURRENT-DATE

  • !CURRENT-DATE-TIME

  • !CURRENT-TIME

  • !EQUATION-NAME

  • !PROCESS-INSTANCE

  • !RUN-CNTL-ID

  • OPRID (always read-only, FIND tests are forced to equality)

  • PROCESS-INSTANCE (passed in)

  • PROCESS_INSTANCE (actually used)

  • RUN_CNTL_ID

Global Variables Passed in for the Forms Engine Financial Aid Award Notification Letter (FEFANLTR)

The following global variables are passed in:

FANLTR_SEQ

These global variables enable the equation to read the table RUNCNTL_FAN_SEQ, which provides these fields:

  • INSTITUTION

  • AID_YEAR

  • PKG_AWARD_PERIOD

The equation can then assign global or local variables to these fields in order to loop through reading the table FAN_AWD_SEL_VW to determine whether or not to select an EMPLID. If the EMPLID is to be selected, the equation calls the SQL FANLTR_SELECT_STUDENT, passing in the EMPLID.

Note:

No global variables are returned for FEFANLTR.

Global Variables Passed in for Financial Aid Packaging

The following global variables are passed in:

  • EMPLID

  • INSTITUTION

  • AID_YEAR

  • ACAD_CAREER

  • AWARD_PERIOD

  • I_TRGT_FED_RMNEED

  • I_TRGT_INST_RMNEED

  • I_TRUE_FED_RMNEED

  • I_INST_RMNEED

  • I_LAST_AWD_ATM

  • I_TOTAL_AWD_AMT

  • WORK_FIELD_CHAR_01 through 05 (These global variables retain their values between equation calls. Initially, they are blank.)

  • WORK_FIELD_NUM_01 through 05 (These global variables retain their values between equation calls. Initially, they are zero.)

  • A_SELECT (initially blank)

  • A_AMOUNT (initially zero)

The following global variables are examined upon return from the equation:

  • A_SELECT (either "T" or "F", where "T" causes the student to be selected only for equations with the application prompt type of "Fin Aid Packaging Select Eqtns")

  • A_AMOUNT (numeric dollar amount to be returned only for equations with the application prompt type of "Fin Aid Packaging Amount Eqtns")

Global Variables Passed in for Student Financials Tuition Calculation

The following global variables are passed in:

  • EMPLID

  • INSTITUTION

  • ACAD_CAREER

  • STRM

  • BUSINESS_UNIT

  • BILLING_CAREER

  • STDNT_CAR_NBR

  • A_SELECT (initially blank)

  • A_AMOUNT (initially zero)

  • CLASS_NBR

  • CRSE_ID

  • ENROL

  • ACTN_RSN_LAST

  • TRANS_DATE

  • TRANS_TIME

These global variables are examined upon return from the equation:

  • A_SELECT (either "Y" or "N"; only the first character of the string is examined, but only for equations with the application prompt type of "Stdnt Fin Tuition Select Eqtns")

  • A_AMOUNT (dollar amount to be returned, but only for equations with the application prompt type of "Stdnt Fin Tuition Amount Eqtns")

Global Variable Passed in for CommonLine and Common Record CommonLine Loan Validation

The global variable LN_ACTION_STATUS (initially "O" for OK) is passed in.

The following records are already fetched, and you can reference their fields:

  • LN_EDIT_RUN_VW (for CL4 only)

  • SFA_CRCEDRUN_VW (for CRC only)

  • LOAN_ORIGNATN

  • LN_TYPE_TBL

  • LN_CL_PNOTE_VW (for CL4 only)

  • SFA_CRC_PNOTE (for CRC only)

  • LN_DEST_CATG_VW (for CL4 only)

  • SFA_CRC_DCAT_VW (for CRC only)

The edit equation should set this global variable:

LN_ACTION_STATUS (looks for "O" for OK, or for "F" for Failed to pass the edit)

Every edit calls FA_EDGETDEST (CL4) or FACEDGETDEST (CRC), which sets the global DEST_ACTV. Next, the equation must test if the value is "Y" and if not, then return; otherwise, if the edit finds an error, it calls equation FA_EDLOGERR (CL4) or FACEDLOGERR (CRC), passing it the EQUATION_NAME local variable.

Global Variables Passed in for CommonLine and Common Record CommonLine Loan Hold/Release Processing

The following global variables are passed in:

  • AID_YEAR

  • EMPLID

  • INSTITUTION

  • STRM

  • TABLE_ID (always "1")

  • LOAN_TYPE

  • LN_APPL_SEQ

  • DISBURSEMENT_ID

  • ITEM_TYPE

  • RESULT (initially blank)

  • HR_MSG_SET_NBR

  • HR_MSG_NBR

These global variables are examined upon return from the equation:

  • RESULT (either "PASS" or "FAILED")

  • HR_MSG_SET_NBR and HR_MSG_NBR (string numeric Hold/Release message set number and message number are examined only if RESULT is "FAILED")

Global Variable Passed in for Population Selection

This global variable is passed in:

!CALLING-PROCESS-INSTANCE

No global variables are expected upon return; however, rows may be inserted into the target table.

Note:

If a local or global variable does not have an assigned value when it is referenced, then the Equation Engine gives a runtime error. See the EXISTS keyword for more details.

Tables and Fields

You can read and use the table and fields by defining the tables to be used in the Equation Data Tables page.

Access the Equation Data Tables page (Set Up SACR, and then Common Definitions, and then Equation Engine, and then Equation Data Tables).

This example illustrates the fields and controls on the Equation Data Tables page . You can find definitions for the fields and controls later on this page.

Equation Data Tables page

If you reference a table-field but that table has not been read, then an implicit read will be performed with the assumption that the global variables are defined the same as the key to that table (for example, EMPLID, INSTITUTION, STRM, and so on). After the table is read, the first value of the read will be placed in that field.

Runtime Errors

If a variable is referenced but it has not been assigned a value, then a runtime error will occur. Also, if a table field is referenced and the fetch count is zero (no rows found), then a runtime error will also occur. One way of avoiding this error is to use the EXISTS keyword to determine whether the field or variable had a value and to either set a default value or issue a modified message and halt. This situation might occur if you call another equation that expects a local variable to be passed.