HLASM Language Reference
HLASM Language Reference HLASM Language Reference
SETC Instruction Notes: 1. The assembler evaluates the represented character string (in particular, the substring, see “Substring Notation” on page 371) before applying the duplication factor. The resulting character string is then assigned to the SETC symbol in the name field. For example: &C2 SETC 'ABC'.(3)'ABCDEF'(4,3) assigns the value 'ABCDEFDEFDEF' to &C2. 2. If the character string contains double-byte data, then redundant SI/SO pairs are not removed on duplication. For example: &C3 SETC (3)'' assigns the value '' to &C3. 3. To duplicate double-byte data, without including redundant SI/SO pairs, use the substring notation. For example: &C4 SETC (3)''(2,4) assigns the value '.A.B.A.B.A.B' to &C4. 4. To duplicate the arithmetic value of a previously defined ordinary symbol with an absolute value, first assign the arithmetic value to a SETA symbol. For example: A EQU 123 &A1 SETA A &C5 SETC (3)'&A1' assigns the value '123123123' to &C5. Subscripted SETC Symbols The SETC symbol (see ▌1▐ in Figure 102 on page 371) in the name field can be subscripted, but only if the same SETC symbol has been previously declared (see ▌2▐ in Figure 102) in a GBLC or an LCLC instruction with an allowable dimension. The assembler assigns the character value represented in the operand field to the position in the declared array (see ▌3▐ in Figure 102) given by the value of the subscript. The subscript expression must not be 0 or have a negative value. 370 HLASM V1R5 Language Reference
Substring Notation LCLC &C1,&C2 LCLC &SUBSCRC(2) . ▲ ┌─── ▌1▐ . └─── ▌2▐ ▼ . &SUBSCRC(1) SETC 'ABCDE' . │ . │ . │ ────────────────────────┼────────────────────────────────────────────── ▌3▐─────┐ &SUBSCRC Array: │ ▼ ┌─────┬─────┬─────┬────/ /────┬─────┬─────┬─────┬────/ /────┬─────┐ │ │ │ │ │ABCDE│ │ │ │ │ └─────┴─────┴─────┴────/ /────┴─────┴─────┴─────┴────/ /────┴─────┘ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ 1 2 3 4 1 11 12 13 2 Figure 102. Subscripted SETC Symbols Character (SETC) Expressions The main purpose of a character expression is to assign a character value to a SETC symbol. You can then use the SETC symbol to substitute the character string into a model statement. You can also use a character expression as a value for comparison in condition tests and logical expressions. Also, a character expression provides the string from which characters can be selected by the substring notation. Substitution of one or more character values into a character expression lets you use the character expression wherever you need to vary values for substitution or to control loops. A character string consists of any combination of characters enclosed in single quotation marks. Variable symbols are allowed. The assembler substitutes the representation of their values as character strings into the character expression | before evaluating the expression. Up to 1024 characters are allowed in a character expression. An attribute reference must be the only term in a character expression. Substring Notation: The substring notation lets you refer to one or more characters within a character string. You can, therefore, either select characters from the string and use them for substitution or testing, or scan through a complete string, inspecting each character. By concatenating substrings with other substrings or character strings, you can rearrange and build your own strings. The substring notation can be used only in conditional assembly instructions. Figure 103 shows how to use the substring notation. Chapter 9. How to Write Conditional Assembly Instructions 371
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 352 and 353: Data Attributes Assembler gives a t
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
- Page 384 and 385: SETB Instruction ┌─────
- Page 386 and 387: SETB Instruction | ISDEC | Format:
- Page 388 and 389: SETB Instruction The two comparands
- Page 392 and 393: Figure 103. Substring Notation in C
- Page 394 and 395: Loc Object Code Addr1 Addr2 Stmt So
- Page 396 and 397: | B2C('111111') has value '3' | B2C
- Page 398 and 399: | Output: D2B('decstring') converts
- Page 400 and 401: SIGNED Format: Logical-expression,
- Page 402 and 403: | X2D('') has value '+' | X2D('91')
- Page 404 and 405: Concatenation of strings containing
- Page 406 and 407: MACRO &NAME MOVE &TO,&FROM LCLC &PR
- Page 408 and 409: SETAF Instruction Alternative State
- Page 410 and 411: Branching Branching You can control
- Page 412 and 413: AGO Instruction The extended AIF in
- Page 414 and 415: ACTR Instruction AGOB—Synonym of
- Page 416 and 417: ANOP Instruction statement processe
- Page 418 and 419: MHELP Instruction MHELP B'10000000'
- Page 420 and 421: 400 HLASM V1R5 Language Reference
- Page 422 and 423: Assembler Instructions and Statemen
- Page 424 and 425: Assembler Instructions and Statemen
- Page 426 and 427: Assembler Instructions and Statemen
- Page 428 and 429: Summary of Constants Figure 113. Su
- Page 430 and 431: Macro and Conditional Assembly Lang
- Page 432 and 433: Macro and Conditional Assembly Lang
- Page 434 and 435: Macro and Conditional Assembly Lang
- Page 436 and 437: Macro and Conditional Assembly Lang
- Page 438 and 439: Macro and Conditional Assembly Lang
SETC Instruction<br />
Notes:<br />
1. The assembler evaluates the represented character string (in particular, the<br />
substring, see “Substring Notation” on page 371) before applying the<br />
duplication factor. The resulting character string is then assigned to the SETC<br />
symbol in the name field. For example:<br />
&C2 SETC 'ABC'.(3)'ABCDEF'(4,3)<br />
assigns the value 'ABCDEFDEFDEF' to &C2.<br />
2. If the character string contains double-byte data, then redundant SI/SO pairs<br />
are not removed on duplication. For example:<br />
&C3 SETC (3)''<br />
assigns the value '' to &C3.<br />
3. To duplicate double-byte data, without including redundant SI/SO pairs, use the<br />
substring notation. For example:<br />
&C4 SETC (3)''(2,4)<br />
assigns the value '.A.B.A.B.A.B' to &C4.<br />
4. To duplicate the arithmetic value of a previously defined ordinary symbol with<br />
an absolute value, first assign the arithmetic value to a SETA symbol. For<br />
example:<br />
A EQU 123<br />
&A1 SETA A<br />
&C5 SETC (3)'&A1'<br />
assigns the value '123123123' to &C5.<br />
Subscripted SETC Symbols<br />
The SETC symbol (see ▌1▐ in Figure 102 on page 371) in the name field can be<br />
subscripted, but only if the same SETC symbol has been previously declared (see<br />
▌2▐ in Figure 102) in a GBLC or an LCLC instruction with an allowable dimension.<br />
The assembler assigns the character value represented in the operand field to the<br />
position in the declared array (see ▌3▐ in Figure 102) given by the value of the<br />
subscript. The subscript expression must not be 0 or have a negative value.<br />
370 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>