HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using SETB symbols

HLASM Language Reference
SC26-4940-06

The logical value assigned to a SETB symbol is used for the SETB symbol appearing in the operand field of an AIF instruction or another SETB instruction.

If a SETB symbol is used in the operand field of a SETA instruction, or in arithmetic relations in the operand fields of AIF and SETB instructions, the binary values 1 (true) and 0 (false) are converted to the arithmetic values 1 and 0.

If a SETB symbol is used in the operand field of a SETC instruction, in character relations in the operand fields of AIF and SETB instructions, or in any other statement, the binary values 1 (true) and 0 (false), are converted to the character values '1' and '0'.

The following example illustrates these rules. It assumes that (L'&TO EQ 4) is true, and (S'&TO EQ 0) is false.
          MACRO
 &NAME    MOVE            &TO,&FROM
          LCLA            &A1
          LCLB            &B1,&B2
          LCLC            &C1
 &B1      SETB            (L'&TO EQ 4)        Statement 1
 &B2      SETB            (S'&TO EQ 0)        Statement 2
 &A1      SETA            &B1                 Statement 3
 &C1      SETC            '&B2'               Statement 4
          ST              2,SAVEAREA
          L               2,&FROM&A1
          ST              2,&TO&C1
          L               2,SAVEAREA
          MEND
 -------------------------------------------------------------------
 HERE     MOVE            FIELDA,FIELDB
 -------------------------------------------------------------------
+HERE ST             2,SAVEAREA
+    L               2,FIELDB1
+    ST              2,FIELDA0
+    L               2,SAVEAREA

Because the operand field of statement 1 is true, &B1 is assigned the binary value 1. Therefore, the arithmetic value +1 is substituted for &B1 in statement 3. Because the operand field of statement 2 is false, &B2 is assigned the binary value 0. Therefore, the character value 0 is substituted for &B2 in statement 4.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014