SETN
Can be used in FASTREXX condition expressions.
Defines or changes a numeric variable.
- name
- 1–256 character variable identifier. Variable name matching is not case sensitive. Cannot be a system character variable or a system numeric variable. See Using FASTREXX variables.
- value
- An integer or substitute numeric or tally variable preceded with an optional plus or minus sign. The number can set,increment, or decrement the respective value in the variable. The variable is initialized with a zero value if it does not exist. The presence of a plus or minus symbol indicates the number provided is to increment or decrement the current valuerespectively. The absence of plus or minus symbols indicates the number is to replace the current value. Ensure that the value is enclosed in quotation marks if a plus or minus sign is specified. A substitute variable name should begin with an ampersand (&variable_name). This must refer to an existing tally or numeric variable. If the variable does not exist, the procedure fails with a severe error. The maximum number supported is 31 digits plus sign.
Example 1
Count the number of records with surname smith that have an age over 50.
If FLDI(1,20,C,'CU','SMITH') and FLD(25,,P) > 50 then
SETN ('Smith_over_50','+1')
Example 2
Save tally value for first 50 record.
TALLY(1,P,'Total Car crashes')
IF RECSIN() = 50 then
SETN('Total_first_50','&total car crashes')