On 6/9/24 12:00, Jonathan Scott wrote:
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.
.
I have little sympathy for perpetuating a "bad design" in the
name of "compatibility". That is embarking on the path to chaos.
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.
.
And far less sympathy for users who adopt a bizarre accommodation
to an error rather than opening a ticket and getting a fix. They
should have added an AIF so their code would continue to work
after a PTF was installed.
But thanks for the explanation.
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'
.
That example In the Language Ref. should be extended to show
the effect of SIGNED in contexts beyond SETC, such as:
2 &A SETA -10
3 UE EQU &A Unsigned 10
0000000A +UE EQU 10 Unsigned 10
4 &C SETC SIGNED(&A) Signed -10
5 E EQU &C Signed -10
FFFFFFF6 +E EQU -10 Signed -10
6 SE EQU SIGNED(&A) "for SETA, SETB, and SETC"
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.
.
At
<https://www.ibm.com/docs/en/hla-and-tf/1.6?topic=symbols-introducing-built-in-functions>
I did not find that example appearing in the Ref. pdf. Did I
miss a hyperlink?
I submitted a Feedback on the missing example. Alas, Feedback
provides no acknowledgement as the older RCF did.
--
Thanks again for your attention,
gil