Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Cobol > Re: MOVE COMP-3...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 10 Topic 4043 of 4243
Post > Topic >>

Re: MOVE COMP-3 TO DISPLAY.

by "Pete Dashwood" <dashwood@[EMAIL PROTECTED] > Mar 7, 2008 at 02:48 PM

"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."
>
 




 10 Posts in Topic:
MOVE COMP-3 TO DISPLAY.
pottmi <pottmi@[EMAIL   2008-03-05 16:00:26 
Re: MOVE COMP-3 TO DISPLAY.
"Pete Dashwood"  2008-03-06 13:48:48 
Re: MOVE COMP-3 TO DISPLAY.
spambait@[EMAIL PROTECTED  2008-03-06 02:36:56 
Re: MOVE COMP-3 TO DISPLAY.
docdwarf@[EMAIL PROTECTED  2008-03-06 01:26:24 
Re: MOVE COMP-3 TO DISPLAY.
pottmi <pottmi@[EMAIL   2008-03-05 18:17:18 
Re: MOVE COMP-3 TO DISPLAY.
Arnold Trembley <arnol  2008-03-06 04:14:58 
Re: MOVE COMP-3 TO DISPLAY.
"Pete Dashwood"  2008-03-07 10:19:02 
Re: MOVE COMP-3 TO DISPLAY.
"Rick Smith" &l  2008-03-06 19:34:38 
Re: MOVE COMP-3 TO DISPLAY.
"Pete Dashwood"  2008-03-07 14:48:53 
Re: MOVE COMP-3 TO DISPLAY.
Howard Brazee <howard@  2008-03-06 07:58:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 8:34:54 CDT 2008.