This format of the @SET statement is used to assign values to line number variables. This value may consist of: a line number specification, the value of an integer variable, the specification of a line number as a string or the binary value of the first 4 bytes in a string.
Operation | Operands | F mode, L mode |
@SET | lvar = { line |
lvar line ivar | Line number variable ( Line number which is to be assigned to the line number variable. Integer variable ( |
SUBSTR string | String which is converted into a line number and assigned to the line number variable. If the string does not represent a valid line number then the |
STRING string | String whose binary value is interpreted as a line number and assigned to the line number variable. In this case the 8 half bytes in the first 4 bytes of the string are each interpreted as a decimal digit. If the string contains fewer than 4 bytes after conversion then it is left-filled with zeros. If the binary value of one of the half bytes in the first 4 bytes of the string does not correspond to a decimal digit |
name | Character set in which the string is to be interpreted. The string is converted If the string contains characters which are invalid in the target character set If the operand is not specified then the character set of the specified string |
In this statement, the statement name may be omitted entirely. In F mode, it is also permissible to omit the statement symbol.
Example
1. @SET #L0 = 1.01 ----------------------------------------------- (1) 1. @SET #I0 = #L0 ------------------------------------------------ (2) 1. @SET #L1 = #I0 ------------------------------------------------ (3) 1. @SET #L2 = SUBSTR '1.01' -------------------------------------- (4) 1. @SET #L3 = STRING X'00010100' --------------------------------- (5) 1. @STATUS = L --------------------------------------------------- (6) #L00= 1.0100 #L01= 1.0100 #L02= 1.0100 #L03= 1.0100 #L04= 0.0000 #L05= 0.0000 #L06= 0.0000 #L07= 0.0000 #L08= 0.0000 #L09= 0.0000 #L10= 0.0000 #L11= 0.0000 #L12= 0.0000 #L13= 0.0000 #L14= 0.0000 #L15= 0.0000 #L16= 0.0000 #L17= 0.0000 #L18= 0.0000 #L19= 0.0000 #L20= 0.0000
(1) | The value 0001.0100 is assigned to the line number variable #L0 . |
(2) | The value 10100 , line number 1.01 * 10000 , is assigned to the integer variable #I1 . |
(3) | The value 0001.0100 is assigned to the line number variable #L1 . |
(4) | The value 0001.0100 is assigned to the line number variable #L2 . |
(5) | The value 0001.0100 is assigned to the line number variable #L3 . |
(6) | The content of the line number variable is output. |