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 notationThe substring notation must be specified as follows:’CHARACTER STRING’(e1,e2)where the CHARACTER STRING is a character expression from which the substring isto be extracted. The first subscript (e1) shows the position of the first character thatis to be extracted from the character string. The second subscript (e2) shows thenumber of characters to be extracted from the character string, starting with thecharacter indicated by the first subscript. Thus, the second subscript specifies thelength of the resulting substring.The second subscript value of the substring notation can be specified as an asterisk(*), to indicate that all the characters beginning at the position of the firstexpression should be used. The extracted string is equal to the length of thecharacter expression, less the number of characters before the starting character.The character string must be a valid character expression with a length, n, in therange 1 through 1024 characters. The length of the resulting substring must be inthe range 0 through 1024.The subscripts, e1 and e2, must be arithmetic expressions.When you use subscripted variable symbols in combination with substringnotation, take care to distinguish variable subscripts from substring-operationsubscripts.LCLC &DVAR(10),&SVAR,&C(10)&C(1) SETC ’&DVAR(5)’ Select 5th element of &DVAR&C(2) SETC ’&SVAR’(1,3) Select substring of &SVAR&C(3) SETC ’&DVAR(5)’(1,3) Select substring of &DVAR(5)&C(4) SETC ’&SYSLIST(1,3)’(1,3) Select substring of &SYSLIST(1,3)Evaluation of substrings: The following examples show how the assemblerprocesses substrings depending on the value of the elements n, e1, and e2.v In the usual case, the assembler generates a correct substring of the specifiedlength:Value of Variable Character ValueNotation Symbol of Substring’ABCDE’(1,5)ABCDE’ABCDE’(2,3)BCD’ABCDE’(2,*)BCDE’ABCDE’(4,*)DE’&C’(3,3) ABCDE CDE’&PARAM’(3,3) ((A+3)*10) A+3v When e1 has a zero or negative value, the assembler generates a null string andissues error message ASMA093E.Character ValueNotation of Substring’ABCDE’(0,5) null character string’ABCDE’(0,*) null character stringv When the value of e1 exceeds n, the assembler generates a null string and issueserror message ASMA092E.Value of Variable Character ValueNotation Symbol of Substring’ABCDE’(7,3) null character string’ABCDE’(6,*) null character stringChapter 9. How to write conditional assembly instructions 367

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

Saved successfully!

Ooh no, something went wrong!