Re: Numeric Edited and VALUE/MOVE
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Sat, 15 Dec 2007 05:49:41 GMT
Robert,
I just looked farther.
Did you see the note under SR(8) which says,
"NOTE The programmer is responsible for specifying the value of a literal
associated with an alphanumeric-edited,
numeric-edited, or national-edited item in edited form."
Value ALl "9"
may be accepted by compilers (I think many/most do) and they may indeed do what
you say, but the source is not conforming to the Standard, so its rules don't
apply.
If you had
05 Num-Ed Pic 99,999.99 Value "12,345.67".
....
Initialize Num-Edi to Value
then all would work "as defined in the Standard".
--
Bill Klein
wmklein <at> ix.netcom.com
"William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx> wrote in message
news:WJJ8j.138292$Hq5.20184@xxxxxxxxxxxxxxxxxxxxxxxxx
Sounds like someone should send J4 an interpretation request.
--
Bill Klein
wmklein <at> ix.netcom.com
"Robert" <no@xxxxxx> wrote in message
news:je56m39r1iar54qglkgu5mgkauafa6tagv@xxxxxxxxxx
On Fri, 14 Dec 2007 16:41:39 +0100, "Roger While" <simrw@xxxxxxxxxxxx> wrote:
In W/S (Assuming no DECIMAL-POINT IS COMMA) -
<level wahtever> MYFLD PIC ZZZ,Z VALUE ALL '9'.
Equivalent in PROCEDURE -
MOVE ALL '9' TO MYFLD.
AFAIK, num-edits are class alphanumeric and as such current
compilers (tested MF/ACU) produce a value of
99999 in MYFLD. (Which, if I am reading the past/current standards
is correct). This seems to me to me to
be non-intuitive. In fact, OC produces 999,9.
Thoughts?
13.16.61.2
8) Editing characters in a picture character-string are included in
determining the size
of the data item, but do not cause editing of the initial value when the data
item is
initialized.
What happens when you INITIALIZE MYFLD TO VALUE? Generally, INITIALIZE
follows the rules
for MOVE, which would give 999,9. However, the Standard muddies the waters by
saying:
14.8.19.3.6.a.3
The actual sending-operand is a literal that, when moved to the
receiving-operand with a
MOVE statement, produces the same result as the initial value of the data
item as produced
by the application of the VALUE clause.
The requirement is impossible. There IS NO LITERAL that will produce 99999
when MOVEd to
MYFLD.
I tried it on Fujitsu. VALUE ZERO gives 00000. INITIALIZE MYFLD gives 000,0.
This compiler
doesn't support TO VALUE.
.
- References:
- working storage values
- From: yoqi99
- Re: working storage values
- From: Richard
- Re: working storage values
- From:
- Re: working storage values
- From: Richard
- Re: working storage values
- From:
- Numeric Edited and VALUE/MOVE
- From: Roger While
- Re: Numeric Edited and VALUE/MOVE
- From: Robert
- Re: Numeric Edited and VALUE/MOVE
- From: William M. Klein
- working storage values
- Prev by Date: Re: working storage values
- Next by Date: Re: Reading CopyBook & Data Files
- Previous by thread: Re: Numeric Edited and VALUE/MOVE
- Next by thread: Re: Numeric Edited and VALUE/MOVE
- Index(es):
Relevant Pages
|