11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Substring notationv When e2 has a value less than one, the assembler generates the null characterstring. If e2 is negative, the assembler also issues error message ASMA095W.Value of Variable Character ValueNotation Symbol of Substring’ABCDE’(4,0) null character string’ABCDE’(3,-2) null character stringv When e2 indexes past the end of the character expression (that is, e1+e2 isgreater than n+1), the assembler issues warning message ASMA094I, andgenerates a substring that includes only the characters up to the end of thecharacter expression specified.Value of Variable Character ValueNotation Symbol of Substring’ABCDE’(3,5)CDEFigure 43 shows the results of an assembly of SETC instructions with differentsubstring notations.Loc Object Code Addr1 Addr2 Stmt Source Statement <strong>HLASM</strong> R6.0 2008/07/11 17.488 &STRING SETC ’STRING’ 000080009 &SUBSTR1 SETC ’&STRING’(0,4) 00009000** ASMA093E Substring expression 1 less than 1; default=null - OPENC10 &SUBSTR2 SETC ’&STRING’(7,4) 00010000** ASMA092E Substring expression 1 points past string end; default=null - OPENC11 &SUBSTR3 SETC ’&STRING’(3,0) 0001100012 &SUBSTR4 SETC ’&STRING’(3,-2) 00012000** ASMA095W Substring expression 2 less than 0; default=null - OPENC13 &SUBSTR5 SETC ’&STRING’(3,4) 0001300014 &SUBSTR6 SETC ’&STRING’(3,5) 00014000** ASMA094I Substring goes past string end; default=remainder15 END 00015000Figure 43. Sample assembly using substring notationYou can suppress the ASMA094I message by specifying the FLAG(NOSUBSTR)option or by setting the ACONTROL FLAG(NOSUBSTR) value. When this is done,the listing changes (Figure 44).Loc Object Code Addr1 Addr2 Stmt Source Statement <strong>HLASM</strong> R6.0 2008/07/11 17.487 ACONTROL FLAG(NOSUBSTR)8 &STRING SETC ’STRING’ 000080009 &SUBSTR1 SETC ’&STRING’(0,4) 00009000** ASMA093E Substring expression 1 less than 1; default=null - OPENC10 &SUBSTR2 SETC ’&STRING’(7,4) 00010000** ASMA092E Substring expression 1 points past string end; default=null - OPENC11 &SUBSTR3 SETC ’&STRING’(3,0) 0001100012 &SUBSTR4 SETC ’&STRING’(3,-2) 00012000** ASMA095W Substring expression 2 less than 0; default=null - OPENC13 &SUBSTR5 SETC ’&STRING’(3,4) 0001300014 &SUBSTR6 SETC ’&STRING’(3,5) 0001400015 END 00015000Figure 44. Sample assembly using substring notation with messages suppressedCharacter (SETC) expressions can be used only in conditional assemblyinstructions. Table 61 shows examples of using character expressions.Table 61. Use of character expressionsUsed in Used as ExampleSETC instruction Operand &C SETC ’STRING0’368 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!