On 12/29/15, Paul Gilmartin posted one of his favorites: 
 
 000000                00000 00002     1 LOC1     CSECT 
 000000                00000 00002     2 LOC2     LOCTR 
 000000                                3 LOC2C    DS    0C 
 000000                                4 LOC2H    DS    H 
 000000                00000 00002     5 LOC1     LOCTR 
 000000                                6          DS    (LOC2H-LOC2C)C 
 ** ASMA080E Statement is unresolvable
 000000                                7          DS    0H 
                                       8          END 
 
and commented first: 
 
 "It's ironic that every expression depends only on symbols which appear 
 earlier in the source, but may be unresolvable." 
 
This is because a LOCTR group is a set of statements to which values are 
not assigned until the complete sequence of LOCTRs and CSECT statements 
have been processed -- effectively, they are "suspended" with unknown 
values at the time statement 6 is encountered.  In this specific case, 
it's not known yet whether the symbol LOC2H will require a padding byte to 
 
follow the LOC2C symbol. 
 
He then commented: 
 
"I wonder whether HLASM's lookahead is documented sufficiently completely 
that a determined programmer with the Reference can decide the correctness 
 
of any program without performing a test?" 

First, the problen in the little program example above has nothing to do 
with lookahead mode, which is specific to conditional assembly. When the 
attributes of a symbol are required in a conditional assembly expression,
and the symbol is unknown, the assembler makes a forward scan over the 
SYSIN file searching for a first occurrence of the symbol. It doesn't 
matter whether or not that occurrence will eventually appear in the final
assembled version of the program. 
 
Second, a "determined" programmer can indeed decide on the correctness of
a such program; but it's much easier to let HLASM do the work for you. 
 
I hope this helps clarify both situations. 
Regards... John Ehrman

Reply via email to