bdfs1m1gStructured Programming Macros

IF Macro Group

Use this macro group to define code process specific code based on a set of conditions. The IF macro group includes the following macros:

Format







IF
specifies the start of the IF structure based on a conditional expression.

ccmask
is any value that can be used as the mask in a branch on condition instruction. The SPMEQ equate macro defines some of these condition code masks.

booleanop
is one of the following Boolean connectors:

arithval
is a number represented directly in numeric form or in symbolic form. This value can be one of the following:

operator
is one of the following relational operators:
Operator
Description
 = 
Equal
 EQ 
Equal
 ¬= 
Not equal
 NE 
Not equal
 < 
Less than
 LT 
Less than
 > 
Greater than
 GT 
Greater than
 <= 
Less than or equal
 LE 
Less than or equal
 >= 
Greater than or equal
 GE 
Greater than or equal.

strcon
is a string constant, which can be one of the following:

strsymbl
is a symbol that represents a character string. This symbol must be defined with a CHARACTER attribute. See DCL-Declare for more information about defining the attribute for a symbol.

OFFSET,byteoff
specifies a substring, where byteoff is the distance (starting from zero) from the leftmost byte of the string. For example,
  C'12345',OFFSET,3

resolves to a substring of C'45'.

See the restrictions listed in the programming considerations.

LENGTH,bytelen
specifies a substring, where bytelen is the length of the string starting from the leftmost byte. For example,
  C'12345',LENGTH,4

resolves to a substring of C'1234'.

See the restrictions listed in the programming considerations.

PAD,padval
concatenates a character, padval, on the end of a string to fill out the string to the end of the declared length.

See the restrictions listed in the programming considerations.

bitsymbl
is a symbol that represents a value for the bit mask comparison. This symbol can be defined with any attribute, but only the leftmost byte is used in the comparison. See DCL-Declare for more information about defining the attribute for a symbol.

L'bitsymbl
specifies the length of bitsymbl and resolves to the number of bytes of storage that bitsymbl represents.

MASK,bitmsk
specifies a bit mask, where bitmsk is a value that can be used as immediate data for a test under mask (TM) instruction. See ESA/370 Principles of Operation or ESA/390 Principles of Operation for more information about the TM instruction.

THEN
specifies the start of the code to process when the conditional expression is true.

code1
is the code to process when the conditional expression is true.

ELSE
specifies the start of the code to process when the conditional expression is false.

code2
is the code to process when the conditional expression is false.

ENDIF
ends the IF structure.

Entry Requirements

None.

Return Conditions

Programming Considerations

Examples

The following examples assume that the attributes for the referenced symbols have been defined with following DCL macro statements:

         DCL   EOFSW,UNSIGNED,1
         DCL   I,SIGNED,4
         DCL   X,SIGNED,4
         DCL   Y,SIGNED,4
         DCL   Z,SIGNED,2
         DCL   AMOTXT,CHARACTER,99
         DCL   ARG,CHARACTER,4
         DCL   R3,REGISTER,3
         IF    EOFSW,=,0
 

Related Macros