IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Move some value into 88 Leval Variable.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raghukuna15

New User


Joined: 02 Dec 2010
Posts: 2
Location: Chennai

PostPosted: Thu May 31, 2012 8:45 pm
Reply with quote

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
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Thu May 31, 2012 9:03 pm
Reply with quote

Please use "DISPLAY IMSP-NMS" and "DISPLAY IMSN-WMS" (if you can)and show us what you get.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 31, 2012 9:05 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu May 31, 2012 9:24 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 01, 2012 12:35 am
Reply with quote

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
View user's profile Send private message
raghukuna15

New User


Joined: 02 Dec 2010
Posts: 2
Location: Chennai

PostPosted: Fri Jun 01, 2012 5:26 pm
Reply with quote

Thanks to all for clarifying my doubt.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top