All,
as some of you know, I'm busy porting my html generator
from z390 to HLASM proper. During the process I am
encountering an apparent peculiarity in the evaluation
of the Count attribute (K') for SETC variables.
Let me first give you the data.
Here's a snippet from my macro, where I have inserted
debugging logic because I suspect a problem with the
evaluation of the K' attribute for variable &CARD, which
holds the value of a generated card image to be punched.
MHELP 71
&QQW SETA (K'&CARD) **!!
MNOTE 8,'&CARD' **!!
MNOTE 8,'Length=&QQW' **!!
AIF (&QQW GT 60).HOPPA
.HOPPA ANOP ,
MHELP 0
Here is the output from HLASM assembly, clipped
from the listing - irrelevant variables removed from
the variable dump:
41915+ MHELP 71
01-HTMLG
** ASMA254I *** MNOTE *** 41916+ 8, <td><a
href="opcd/unkcf002.htm">Test Vector Entry</aX01-HTMLG
+ ></td>
** ASMA254I *** MNOTE *** 41917+ 8,Length=72
01-HTMLG
//MHELP AIF IN HTMLGEN MODEL
STMT=00000 DEPTH=001 SYSNDX=0035015 KWCNT=000
1
Page 139
Active Usings: None
0 Loc Object Code Addr1 Addr2 Stmt Source Statement
HLASM R6.0 2010/12/17 13.26
0 ////SET SYMBOLS (SKIPPED NUMBERS MAY
BE SEQUENCE SYMBOLS).//
//0007 LCLC CARD
LNTH= 072
// HEX
VAL=40404CA3846E4C8140889985867E7F9697838461A495928386F0F0F24B88A394
//
7F6EE385A2A350509582A2975EE58583A3969950509582A2975EC595A399A84C
// 61816E4C61A3846E
// VAL= <td><a
href="opcd/unkcf002.htm">Test& Vector& Entry<
Please mind the line wraps, should they occur.
What this shows to me is the following:
1) The first MNOTE shows the content of the &CARD variable.
I count exactly 70 characters.
2) The second MNOTE shows that HLASM count attribute
for the same string evaluates to 72 characters.
3) The dump of variable &CARD shows that ampersands
are stored as a sequence of two ampersands.
This shows on both the character dump and on the
hex dump.
4) The VAL= line in the variable dump is truncated at the right
I must admit that I find it counter-intuitive that HLASM would
store the double ampersands in the variable, rather than
undouble them during the assignment. But well - as long as
the results are consistent - I really shoulnd't need to care.
Now what does the Language Reference say on this?
I copy from SC26-4940-05 page 332:
<quote>
The count attribute applies only to macro instruction operands, to SET symbols,
and to the system variable symbols. It has a numeric value equal to the number
of
characters:
- That constitute the macro instruction operand, or
- That would be required to represent as a character string the current value of
the SET symbol or the system variable symbol.
</quote>
Extracting the part that I think relates to my situation:
The count attribute applies ... to SET symbols... It has a numeric value equal
to
the number of characters... that would be required to represent as a character
string
the current value of the SET symbol...
As we have seen on the preceding MNOTE the "the number of characters required
to represent as a character string the current value of the SET symbol" is 70,
not 72.
So I am confused - to say the least. Do I err in my reasoning?
Is there a deficiency in the LR description of the K' attribute?
Is this a bug in HLASM?
Kind regards,
Abe Kornelis.
==========