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

Re: MOVE COMP-3 TO DISPLAY.

by spambait@[EMAIL PROTECTED] (Doug Miller) Mar 6, 2008 at 02:36 AM

In article <638tbgF26nicjU1@[EMAIL PROTECTED]
>, "Pete Dashwood"
<dashwood@[EMAIL PROTECTED]
> wrote:

> 01 ACOMP3 PIC 9999v9 COMP-3.
> 01 ADISPLAY PIC X(6).
>
>.... add two lines...
> 01 ADISPLAY-EDITED PIC z(4).9.
> 01 ADSTRING REDEFINES ADISPLAY-EDITED PIC X(6).
>....
> MOVE 1234.5 to ACOMP3.
>MOVE ACOMP3 TO ADISPLAY-EDITED.
>MOVE ADSTRING TO ADISPLAY.
>DISPLAY ADISPLAY.

Even simpler:

01 ADISPLAY.
   03 ADISPLAY-EDITED PIC Z(4).9.
...
MOVE 1234.5 TO ACOMP3.
MOVE ACOMP3 TO ADISPLAY-EDITED.
DISPLAY ADISPLAY.

To the OP: even though this may not look like it, it *does* satisfy your 
constraint that the definition of ADISPLAY remain unchanged, as all group 
items are PIC X(n) by default, where n is the aggregate length of the 
elementary items comprising the group. Since there is only one elementary
item 
(ADISPLAY-EDITED), and it's six characters long, the default picture of
the 
group item ADISPLAY is PIC X(6).

-- 
Regards,
        Doug Miller (alphageek at milmac dot com)

It's time to throw all their damned tea in the harbor again.
 




 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 23:02:28 CDT 2008.