FORM.CALC uses expressions written in REXX, which is not available in CICS.
On the FORM.CALC panel you can enter expressions for report calculations. It initially contains only one row, a place for one expression. However, up to 998 additional rows can be inserted.
Each entry area is described in terms of its effect on reports. FORM.CALC does not affect charts.
FORM.CALC C D E A B PASS For &CALCid ID CALCULATION EXPRESSION NULLS? WIDTH EDIT --- --------------------------------------------- ------ ----- ----- NO 10 C *** END *** 1=Help 2=Check 3=End 4=Show 5=Chart 6=Query 7=Backward 8=Forward 9= 10=Insert 11=Delete 12=Report OK, Cursor positioned. COMMAND ===> SCROLL ===> PAGE
The&CALCid variable can be used only in detail block text, final text, and break footing text. CALCid and &CALCid activate the evaluation of the calculation expression on FORM.CALC whose ID equals id.
For an &CALC variable, the evaluated result is edited according to the width and edit code specified for the expression in the FORM.CALC panel (subject to the special factors described in Summary of Editing Expressions). For a CALCid usage code, the evaluated result is edited according to the width of the columns and the edit code of the CALC.
Other than &CALCid, any valid form variable can be used in the expressions. The following variables are valid:
For a description of &COUNT, see page*** under BREAK1 FOOTING TEXT.
For descriptions of &DATE, &TIME, and &PAGE, see page *** under BREAK1 HEADING TEXT.
When an expression is entered, its variables are validated. Column variables are checked for valid column numbers and for compatible usages or edit codes or both. For example, if the sixth column has an edit code of C and the expression uses &SUM6, an error exists and a message is issued.
Be sure to use substitution variables that are compatible with the expression. QMF does not check for nonnumeric substitution variables in an arithmetic expression.
If you encounter a syntax error on the expression, you must correct it either in the REXX exec itself or in the REXX expression. Be sure to follow the REXX coding rules.
For example, you include in the expression an exec name that does not exist. After you correct the exec name or create the exec, show F.CALC and make any necessary modifications. If you do not need to make any other changes, retype one of the characters in the expression. Doing this causes QMF to validate the variables again to ensure you have built your form correctly. If you do not revalidate your form, you might get unpredictable results.
If a null value is returned by the REXX expression, you can pass it to your report.
If the expression contains a substitution value that is null, undefined, overflow, has no instance or no relationship, then the entire expression will be set to that value that represents that condition. This expression reduction is performed only on expressions, not comparisons.
If the expression contains more than one substitution value that is null, undefined, overflow, has no instnace or no relationship, then the following order of precedence will be used for expression reduction:
If a null value is returned by the REXX expression, you can pass it to your report.
For more information see the:@IF function.
WIDTH is a five character entry field. It must contain a number from 1 through 32767. The default is 10.
EDIT is a five character field. The default is C for character data when a line is inserted in FORM.COLUMNS. Only the following edit codes are accepted: