Looks like an old homework question or job interview question.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Lizette Koehler
Sent: Wednesday, August 01, 2007 6:53 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: COBOL Group moves

Steve,

I am thinking that this might be better put to the Cobol language group
on
Google?

There he could get the kind of details on COBOL that he might actually
be
asking about.

Lizette


> >
> > I have a query regarding the following group move:
> >
> > 01 GRP1.
> >      05      N1           PIC S9(9) COMP-3 VALUE +0.
> >      05      N2           PIC S9(9) COMP-3 VALUE +0.
> >
> > 01 GRP2.
> >      05      N3           PIC S9(9) COMP-3 VALUE +123.
> >
> > 01 N4      PIC ZZZ,ZZZ,ZZ9.
> >
> > PROCEDURE DIVISION.
> >     INITIALIZE GRP1.
> >     MOVE GRP2 TO GRP1.
> >     MOVE N2 TO N4.
> >     DISPLAY N4.
> >
> > What value is displayed and why?
> >
> > Regards,
> > Rashmi
> 
> Seems a bit off topic for ibm-main, and you could just
> run an experiment. But I'll have a go. You really only
> have one group move here: move grp2 to grp1. A group
> move is a character move, so the five bytes of N3 are
> placed over the five bytes of N1 and the rest of grp1
> (that turns out to be all of n2) is padded with blanks.
> 
> The result of moving blanks, then, to an edited
> numeric field depends somewhat on various compiler
> settings. I really don't have the time to test out
> all the possibilities right now. I would rather, at
> this  point, throw the question back: what are you
> trying to accomplish? Why do you ask?
> 
> Steve Comstock

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to