I have one question on the following code snippet.

If you code a VALUE on an 05 level, do you still have to INITIALIZE the group 
level?

My cobol is very rusty.

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

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