Use VarDeclare to create a new variable.
VarDeclare may also be entered as VarDecl[are], Decl[are], or DCL.
Required Operands
NAME NAME can be up to 8 characters in length, composed of the letters A-Z, the numerals 0-9, and the special characters dollar sign ($), underscore (_), and number sign (#). NAME must NOT start with any of the following three-letter prefixes as these are reserved for predefined variables:
AUD JQE PWR TXM
CCB MCB SIB TXS
CLP MMP SSD TXT
DFS OPS SSL TXU
JCT PDB SSP TXX
JOE PPD TXL XTR
TYPE dd. Specify "CHAR" for a character variable or "NUM" for a numeric variable.
LENGTH specifies the maximum length the variable data can assume. For numeric data (TYPE=NUM), length must be a value between 1 and 8. Signs are not processed by BIM-EDIT/XP For character data (TYPE=CHAR), length must be a value between 1 and 253.
Optional Operands
FMT controls the manner in which variables are replaced within text or commands. The following formats are provided:
F indicates that the replacement value of the variable will always occupy LENGTH characters i.e. it is of "fixed" length. Padding will take place with blanks on the right for CHAR variables and with zeroes on the left for NUM variables.
V the default, indicates that the replacement string will occupy a varying number of positions, determined by the current length of the variable data.
Z is specified only for numeric variables. It functions like FMT="F", except that the leading zeros are replaced with blanks.
E is specified only for numeric variables. Numeric variables are "edited" by inserting commas and suppressing leading zeros. As such, the replacement string may occupy more positions than its declared length.
If FMT is not specified, V is assumed.
Examples:
------------ <&VALUE.> --------------
DECLARE SET VALUE FMT=F FMT=V FMT=Z FMT=E
CHAR,6 'ABCD' <ABCD > <ABCD>
CHAR,6 ' BC ' < BC > < BC >
NUM,6 5 <000005> <5> < 5> < 5>
NUM,6 5000 <005000> <5000> < 5000> < 5,000>
CASE specifies whether input data from the TextMap and ProcParse commands is to be translated to upper case. If CASE is specified as U, translation will occur. If CASE is specified as M, translation will not occur. If CASE is not specified, translation will occur.
SCOPE specifies which procedures have access to this variable.
LOCAL (default) the variable is known only within the current procedure, and only for the life of the current procedure.
GLOBAL the variable is known to all other procedures in current procedure execution.
USER the variable is known to all procedures executed by the current user as long as the user is logged on to the BIM-EDIT system.
SYSTEM the variable is known to all procedures for all users until BIM-EDIT is shut down. SYSTEM variables can only be declared and set by users with ADM command security .
Variables, if not predefined, must be declared prior to being referenced. Variables are usually declared at the start of a procedure. Variables should not be declared within a section of the procedure that is executed multiple times. Such a situation would result in a "variable already declared" error on the second iteration.
Character variables are initialized to a blank value. Numeric variables are initialized to a zero value.
Variables declared with SCOPE=GLOBAL provide a convenient means of communicating information between procedures. After global variables are declared, any procedure has complete access to them. Global variables remain declared until BIM-EDIT/XP returns to online command mode. For batch utility or application interface, they remain declared for the entire logon. Variables declared with SCOPE=USER remain declared for the users entire logon. Variables declared with SCOPE=SYSTEM remain declared, until BIM-EDIT EOJ, available for reference by all users. SYSTEM variables should be declared, set or altered only by the system administrator. Procedure $SIT.PROC.SYSTDVB, if it exists, will be executed at BIM-EDIT startup to declare and set SITE standard SYSTEM variables.
Return Codes
OK Successful.
Examples
Append the contents of variable OPT3 to variable OPT1:
=> VAPPEND OPT1,OPT3
Append the string "$USR." to variable WORK:
=> VAPPEND WORK,'$USR.'