Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Level 88 with Value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
saurabhgemini10

New User


Joined: 15 Sep 2008
Posts: 5
Location: India

PostPosted: Mon Sep 15, 2008 4:04 pm    Post subject: Level 88 with Value
Reply with quote

Hello All,

77 A PIC X(1)
88 B value "YES"
88 C value "NO"

Will this work??
If this works then what will be the value??
If this doesnt work, then what error??
Please let me know.
Thanks in Advance
Back to top
View user's profile Send private message
References
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 113
Location: chennai

PostPosted: Mon Sep 15, 2008 4:23 pm    Post subject:
Reply with quote

Try it out and then ask a question.....
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 132
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Sep 15, 2008 4:25 pm    Post subject:
Reply with quote

Hi,

Welcome to forum,

the above code will throw error; Any how i will tell use of 88 level

The 88 Level
---------------

Consider an example

Code:
01 A                  PIC X(03).
    88 B                              VALUE "YES".
    88 C                              VALUE "NO".


B is a conditional name; this become true when A will have that value ie when you populate "YES" value to A data items

You can use in this way

say

Code:
PERFORM <para-1> UNTIL B

para-1
--------
     IF <condition>
          MOVE "YES"          TO  A
     END-IF.


the paragraph <para-1> will execute till A attain "YES" Value

Hope this helps...


Check it out link for further assistence

http://ibmmainframes.com/about11085.html
Back to top
View user's profile Send private message
saurabhgemini10

New User


Joined: 15 Sep 2008
Posts: 5
Location: India

PostPosted: Mon Sep 15, 2008 4:30 pm    Post subject:
Reply with quote

Thanks revel...
Back to top
View user's profile Send private message
Marso

Senior Member


Joined: 13 Mar 2006
Posts: 337
Location: Israel

PostPosted: Mon Sep 15, 2008 9:09 pm    Post subject:
Reply with quote

It won't work for 2 reasons:
1. Field is one char long and values are 3 char long.
2. You have to put a period (.) at the end of each sentence in WS.

Assuming that the field is now PIC X(3), it is still without value.
If you want to have a default value, use:
Code:
77  A     PIC X(3) VALUE 'YES'.


revel wrote:
Code:
PERFORM <para-1> UNTIL B

para-1
--------
     IF <condition>
          MOVE "YES"          TO  A
     END-IF.

The whole idea about using level 88 is not to use constants in the program body,
so please use SET A TO TRUE instead of that ugly MOVE statement
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 39
Location: NY

PostPosted: Mon Sep 15, 2008 9:57 pm    Post subject: Reply to: Level 88 with Value
Reply with quote

saurabhgemini10 with all this valuable information do remember that its not necessary to have 77 level variable to define flags(88 level variables) and it is a good practice to give default value to the variable and use set in place of move as suggested by Marso.

Cris
Back to top
View user's profile Send private message
anil.csk

New User


Joined: 22 Oct 2007
Posts: 16
Location: Noida

PostPosted: Tue Sep 16, 2008 1:53 pm    Post subject: Reply to: Level 88 with Value
Reply with quote

i will work fine...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1