View previous topic :: View next topic
|
Author |
Message |
raghukuna15
New User
Joined: 02 Dec 2010 Posts: 2 Location: Chennai
|
|
|
|
Hi,
Please find an example below:
01 REGION-CODE PIC X(04).
88 IMSP-NMS VALUE 'IMSP'
88 IMSN-WMS VALUE 'IMSN'
MOVE 'IMSU' TO REGION-CODE.
SET IMSP-NMS TO TRUE.
Can any one help me what value will be stored in IMSP-NMS and IMSN-WMS?
Regards,
Raghav |
|
Back to top |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
Please use "DISPLAY IMSP-NMS" and "DISPLAY IMSN-WMS" (if you can)and show us what you get. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Sorry, but you completely and totally misunderstand the use of 88 levels. There is NO value stored in IMSP-NMS and IMSN-WMS since they are not data names of variables -- they are conditionals only and cannot be displayed, for example, since they do not have storage allcoated. For proof, here's the code:
Code: |
WORKING-STORAGE SECTION.
01 REGION-CODE PIC X(04).
88 IMSP-NMS VALUE 'IMSP'.
88 IMSN-WMS VALUE 'IMSN'.
/
PROCEDURE DIVISION.
S1000-MAIN SECTION.
MOVE 'IMSU' TO REGION-CODE.
SET IMSP-NMS TO TRUE.
DISPLAY 'REGION CODE:<' REGION-CODE '>'.
DISPLAY 'IMSP-NMS :<' IMSP-NMS '>'.
DISPLAY 'IMSN-WMS :<' IMSP-WMS '>'. |
and the compiler output:
Code: |
000013 WORKING-STORAGE SECTION.
000014 01 REGION-CODE PIC X(04).
000015 88 IMSP-NMS VALUE 'IMSP'.
000016 88 IMSN-WMS VALUE 'IMSN'.
1PP 5655-G53 IBM Enterprise COBOL for z/OS 3.4.1 MF0229 Date 0
LineID PL SL ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6--
000017 /
000018 PROCEDURE DIVISION.
000019 S1000-MAIN SECTION.
000020 MOVE 'IMSU' TO REGION-CODE.
000021 SET IMSP-NMS TO TRUE.
000022 DISPLAY 'REGION CODE:<' REGION-CODE '>'.
000023 DISPLAY 'IMSP-NMS :<' IMSP-NMS '>'.
==000023==> IGYPS2074-S "IMSP-NMS" was defined as a type that was invalid in this context. The
statement was discarded.
000024 DISPLAY 'IMSN-WMS :<' IMSN-WMS '>'.
==000024==> IGYPS2074-S "IMSN-WMS" was defined as a type that was invalid in this context. The
statement was discarded. |
Based upon your posted code, REGION-CODE will have the value IMSP since the SET IMSP-NMS TO TRUE is the same thing as MOVE 'IMSP' TO REGION-CODE. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Looks like an interview question and you could
have figured out yourself by writing a small program
check here for good examples |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
If this is not an interview question, post what you are trying to accomplish and someone may have a suggestion.
Keep in mind that an 88 level entry is "read only" - nothing can be moved to it. |
|
Back to top |
|
|
raghukuna15
New User
Joined: 02 Dec 2010 Posts: 2 Location: Chennai
|
|
|
|
Thanks to all for clarifying my doubt. |
|
Back to top |
|
|
|