My concern is mostly about the value of #RESULT; personally, I expected something more “digital” (or a run-time exception) after
MOVE EDITED #N1-NUM (EM=9(2)9.9999) TO #RESULT
Apparently, I should have used
MOVE EDITED #P1 (EM=9(2)9.9999) TO #RESULT to get the “more natural” 039.1800, but I’d like to hear from you anyway.
I seem to recall that this is as it always has been. When you redefine Alpha and Zoned Decimal, you must be careful, because Natural doesn’t care much about the leading nibble.
On the other hand, with Natural 6 (I don’t have mainframe access anymore) both #N1-NUM and #RESULT display properly.
I guess when applying an edit mask to a N field Natural assumes,
and it makes sense, that the data contained therein is ok, so only
the separators need to be inserted, no transformation takes place.
Well, I guess what Wolfgang means is “… when you put some garbage IN, you’ll get exactly the same “jewelry” OUT” :-), and I can’t disagree less with him
However, I was able to execute “perfectly correctly” 2 more statements:
#P1 := #N1-NUM * 2
DISPLAY ‘=’ #P1 (this last one gives me 78.3600).
As such (I’m getting to the point
39.1H * 2 = 78.36
To me, it’s a good illustration on the subject that “…there are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy”
As Ralph said, you must be careful. Are you sure that you want to coerce a number out of garbage? You might be better off catching this exception with an edit mask or or “IS (N7)” before treating #N1-NUM as a number.
Consider what happens if #N1-ALPHA is initialized as:
1 #N1-ALPHA (A07) INIT <‘039100J’>
Meanwhile (and I mentioned that in my first post),
"…My concern is MOSTLY about the value of #RESULT; personally, I expected something more “digital” (or a run-time exception) after
MOVE EDITED #N1-NUM (EM=9(2)9.9999) TO #RESULT "
Apparently, I did not get right the following (quote for Help from Natural 6.3)
Characters for the Definition of Numeric Edit Masks
Character Function 9 Position to be displayed (one digit of the field value).
Is that “H” character on the alpha (A10) #RESULT field a digit? I’m still a bit confused
No, it (of course) isn’t, but Natural apparently doesn’t check if it is a valid numeric when applying the edit mask, as I tried to explain, no data transformation required throughout the process so there’s no step in the chain which would directly result in an exception.
It’s a case of GIGO (garbage in → garbage out), I’d suggest filing a support incident.
Thank you, Wolfgang, I really appreciate your help.
Well, we have some people in our shop responsible for Adabas/Natural support, and I`m going to contact them.
By the way (this is rather out of curiosity), is there a way to “file a ticket” for “a mere mortal”?