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

Level 88 with Value


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

New User


Joined: 15 Sep 2008
Posts: 5
Location: India

PostPosted: Mon Sep 15, 2008 4:04 pm
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
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Mon Sep 15, 2008 4:23 pm
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: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Sep 15, 2008 4:25 pm
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

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
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Sep 15, 2008 9:09 pm
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: 53
Location: NY

PostPosted: Mon Sep 15, 2008 9:57 pm
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
Reply with quote

i will work fine...
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 How to load to DB2 with column level ... DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts JPM Reports for each DB2 V12 Function... DB2 0
No new posts Program level statistics CICS 6
No new posts Feild level validation to test first ... JCL & VSAM 10
Search our Forums:

Back to Top