For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2007 > Re: Question on Cobol Move statement - mixed move x to zzz9.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Question on Cobol Move statement - mixed move x to zzz9.
Rene_Surop

2007-05-21, 9:55 pm

>
> 05 WS-PROP-PREMISE PIC X(04).
>
> 05 WS-FORMAT-4 PIC ZZZ9.
>
> WS-PROP-PREMISE has a value of 3. That is 3 followed by 3 spaces.
>
> The code MOVE WS-PROP-PREMISE to WS-FORMAT-4 results in
>
> 3000
>

Better yet....

05 WS-PROP-PREMISE PIC X(04).
05 WS-FORMAT-4 redefines WS-PROP-PREMISE PIC ZZZ9.

Then MOVE 3 TO WS-FORMAT-4 instead.... nobody uses REDEFINES anymore.
Aside from shared memory bits, it works all the time.

It should work the first time.... naahh.

Howard Brazee

2007-05-22, 9:55 pm

On 21 May 2007 19:29:50 -0700, Rene_Surop <infodynamics_ph@yahoo.com>
wrote:

>nobody uses REDEFINES anymore.


I'm assuming that you're joking here.
Pete Dashwood

2007-05-22, 9:55 pm


"Rene_Surop" <infodynamics_ph@yahoo.com> wrote in message
news:1179800990.129832.240940@y18g2000prd.googlegroups.com...
> Better yet....
>
> 05 WS-PROP-PREMISE PIC X(04).
> 05 WS-FORMAT-4 redefines WS-PROP-PREMISE PIC ZZZ9.
>
> Then MOVE 3 TO WS-FORMAT-4 instead.... nobody uses REDEFINES anymore.
> Aside from shared memory bits, it works all the time.
>
> It should work the first time.... naahh.
>

REDEFINES is one of the most powerful constructs in COBOL. It can achieve
things no other combination of verbs can achieve. Why would anyone NOT use
it?

Pete.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com