bdfs1m1iStructured Programming Macros

LET-Assignment

Use this macro to assign values to symbols declared with the DCL macro. Symbols can be assigned arithmetic, string, or bit values. These symbols can be used in other structured programming macro (SPM) or in mainline code.

Format




arithvar
is a symbolic name to which the arithmetic value will be assigned. For example:
   LET NUM,=,4

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

arithop
is one of the following arithmetic operators:
Operator
Description
 + 
Addition
 - 
Subtraction
 * 
Multiplication
 / 
Integer division
 // 
Remainder.

constant
is an arithmetic constant that will be assigned to the symbol specified by arithvar. The value must be an integer and must be appropriate for the size of the symbol to which this value will be assigned (arithvar). For example, if the number you specify for constant is greater than 65536, the symbol you specify for arithvar must be declared to be a fullword. See DCL-Declare for more information about declaring the attributes for a symbol.

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.

||
concatenates two or more strings into one string. For example,
  LET PART1,=,C'ABC'
  LET PART2,=,C'123'   LET WHOLE,=,PART1,||,PART2

In this example, WHOLE will have the value C'ABC123'.

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 assignment. In a bit mask assignment, either the leftmost byte or the one byte specified by the OFFSET parameter is used.

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 specifies the portions of the byte affected by the bit that is being assigned. For example:
  LET SYMB,=,C'ABC'
  LET SYMB,MASK,B'00101000',=,1

In this example, the symbol SYMB will contain the value ZBC. This is determined as follows:

     EBCDIC A: B'1100 0001'
      mask on: B'0010 1000'
  set to ones: ------------
   results in: B'1110 1001' or EBCDIC Z

Entry Requirements

None.

Return Conditions

Programming Considerations

Examples

Related Macros

DCL-Declare.