"Rick Smith" <ricksmith@[EMAIL PROTECTED]
> wrote in message
news:13t13ek62h28bad@[EMAIL PROTECTED]
>
> "Pete Dashwood" <dashwood@[EMAIL PROTECTED]
> wrote in message
> news:63b5e8F274l7vU1@[EMAIL PROTECTED]
>>
>>
>> "pottmi" <pottmi@[EMAIL PROTECTED]
> wrote in message
>>
news:2d29289d-7596-46fb-a216-766e7f695e23@[EMAIL PROTECTED]
>> > Pete,
>> >
>> > Your suggestion worked. thanks. I did not know about using a period
>> > in the picture clause, that was the trick that makes the redefines
>> > graceful.
>> >
>> No problem, glad to help.
>>
>> This is called an "insertion" edit character. You can use a few other
> things
>> as well, depending on which compiler you are using.
>>
>> > For the benefit of others, here is a cut and paste ready scrap of
>> > code:
>> > 01 CONSTANTS.
>> > 02 ACOMP3 PIC 9(4)v9 COMP-3.
>> > 02 ADISPLAY PIC X(6).
>> > 02 ANUMERIC PIC Z(4).9.
>> > 02 ASTRING REDEFINES ANUMERIC PIC X(6).
>> > *
>> > PROCEDURE DIVISION.
>> > FIRST-PARA.
>> > MOVE 1234.5 TO ACOMP3.
>> > * MOVE ACOMP3 TO ADISPLAY.
>> > * DISPLAY ADISPLAY.
>> >
>> > MOVE ACOMP3 TO ANUMERIC.
>> > DISPLAY "ASTRING = " ASTRING.
>> >
>> > STOP RUN.
>> >
>> > The commented out MOVE statement produces this error on the latest
>> > version of microfocus compiler:
>> >
>> > pottmi@[EMAIL PROTECTED]
> cob moverule.cbl
>> > 20 MOVE ACOMP3 TO ADISPLAY.
>> > *1029-
>> > E***************************
>> > **
>> > ** A non-integer is being moved to an alphanumeric data item
>> >
>> > Given that, can you clarify your statement that the MOVE is legal?
>> >
>>
>> It certainly looks like it ISN'T legal on MicroFocus. Sorry, I didn't
>> know
>> that. I use Fujitsu, and, although I haven't tried it, I would expect
it
> to
>> work. I would expect to be able to move ANYTHING to an AN receiving
>> field
>> and find it left justifed in that field. (Maybe MY understanding is
>> broken... :-))
>>
>> What the standard actually allows would be the domain of other posters
> here.
>> (I'm sure Bill Klein or Rick Smith can tell us what the current
standard
>> allows and what the 2002 (yet to be implemented) standard proposes.)
>
> 1. The current standard is the 2002 standard. <g>
> 2. Behavior with COMP-3 is not defined in any COBOL standard.
> 3. Moving noninteger to alphanumeric is not a valid move in 2002
> (MOVE statement SR8); nor was it valid, as nearly as I can tell,
> in 85, 74, or 68.
>
Thanks Rick. I stand corrected, and learned something... :-)
Pete.
--
"I used to write COBOL...now I can do anything."
>


|