The problem is specifically that whenever a SETA variable is
substituted into a character string (either within an assembler
statement or within a conditional assembly character expression)
it does not include a minus sign for a negative value.  I would
agree this was bad design, but it happened in the early 1960s
(or possibly even earlier, if this was inherited from pre-360
assemblers) and we have to be very careful about compatibility.
 
The compatibility problem is mainly caused by macros trying to
work round the original problem.  For example, if a SETA symbol
&A is negative they may generate '-&A' instead of '&A', but if
we fix the problem the first form will then incorrectly generate
two minus signs.
 
Gil writes:
> I had been unaware of the SIGNED BiF.
 
It's been in the language since HLASM 1.3 in about 1998.
 
I recommend you check the lists of arithmetic and character
built-in functions to get up to date - there are some very
useful ones in there.
 
> I find the examples in the Language Ref. inadequate:
 
The use of SIGNED is determined by the same syntax rules as
other functions.  You should use the reference information for
arithmetic or character expressions to understand the general
rules.  The examples only illustrate what SIGNED does, and
the generalisation to other cases is a matter of syntax.
 
SIGNED takes an arithmetic operand and returns a character
result, so the typical use is as follows:
 
&A       SETA  -10
...
&C       SETC  SIGNED(&A)   &C is now '-10'
 
> I'd submit a Feedback, but I can't find the web page.
 
In IBM Docs, each page has "Was this topic helpful?" in the top
right corner.  If you don't like something, click on the thumbs
down icon and you will be prompted for input, which will be sent
to the product documentation team for that page.
 
Jonathan Scott, HLASM
IBM Hursley, UK

Reply via email to