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 7 of 10 Topic 4043 of 4195
Post > Topic >>

Re: MOVE COMP-3 TO DISPLAY.

by "Pete Dashwood" <dashwood@[EMAIL PROTECTED] > Mar 7, 2008 at 10:19 AM

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

I think Doug Miller's use of COBOL's implicit hierarchic structure is an 
improvement over what I posted, and I think that what Arnold Trembley had
to 
say is worth noting.

You actually got pretty good value for your assistance request... :-)

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 Fri Jul 25 16:32:28 CDT 2008.