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

What is Cobol Level Number 88


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

New User


Joined: 27 Oct 2004
Posts: 8
Location: Bangalore,INDIA

PostPosted: Wed Oct 27, 2004 6:19 pm
Reply with quote

what does level number 88 does??
Back to top
View user's profile Send private message
chandrasekhar

New User


Joined: 29 Sep 2004
Posts: 35
Location: bangalore

PostPosted: Wed Oct 27, 2004 8:38 pm
Reply with quote

lEVEL NO 88 USED FOR CONDITIONAL NAMES.

You can use a level 88 to set up condition names that can be used to simplify
IF and UNTIL tests.
Level 88 is a special level number used to improve the readability of COBOL
programs and to improve IF tests.
A level 88 looks like a level under another variable, but it's not.
It does not have a PICTURE, but it does have a value.
A level 88 is always associated with another variable and is a condition name
for that variable.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Mon Nov 15, 2004 11:35 pm
Reply with quote

Novice wrote:
what does level number 88 does??


Great Day!

Here is an example:

01 day-of-week pic x(02) value spaces.
88 day-sunday value 'SU'.
88 day-monday value 'MO'
..

Now in your program you can code your if statement like

IF day-sunday
perfrom sunday-process
end-if.
Back to top
View user's profile Send private message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 42
Location: chennai, india

PostPosted: Mon Feb 28, 2005 9:05 am
Reply with quote

Hi,

u have to code as shown below.


Code:
working-storage section.
01 a pic x value spaces.
  88 male value 'm'.
  88 female value 'f'.
procedure division.

Accept a.

If male perform p1
end-if.
if female perform p2
end-if.


Here condition names are used to improve self documentation.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Fri Mar 18, 2005 8:25 pm
Reply with quote

this is used for conditional variable.The parent level of this variable will get the value assigned to the conditional level.E.G.
01 taste pic x(1) value space.
88 sweet value 's'.
88 sour value 'o'.

so if sweet is set to tru then the value of taste variable will be s.if sour is set to tru then the value of taste will be o, otherwise it will be space.
Back to top
View user's profile Send private message
Vijay Bhadauria

New User


Joined: 28 Mar 2005
Posts: 8

PostPosted: Mon Mar 28, 2005 2:43 pm
Reply with quote

Hi,

You can also use 88 level with thru clause or multiple values.

E.g.

01 Char PIC X.
88 Vowel VALUE "a", "e", "i", "o", "u".
88 Digit VALUE "0" THRU "9".
88 Consonant VALUE "b", "c", "d", "f", "g", "h"
"j" THRU "n", "p" THRU "t", "v" THRU "z".
88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9".

In the above case,
Vowel will be true if any of the mentioned values (i.e. a,e,i,o,u) will be assigned to Char.
Digit will be true if any number between 0 and 9 will be assigned to Char.
Same is the case with Consonant and ValidCharacter

Quote:
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Thu Aug 31, 2006 12:49 pm
Reply with quote

PLEASE EXPLAIN HOW TO USE SET TO TRUE USING CONDITION NAMES(LEVEL 88)
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Aug 31, 2006 1:00 pm
Reply with quote

Suppose i am declaring a variable like that
EXEC SQL
DECLARE SOICUR FOR
SELECT POLICY_NUMBER
FROM ILF010VW
END-EXEC

10 WS-DB2-ILF010-RECORDS PC X(1) VALUE 'N'.
88 WS-DB2-ILF010-OVER VALUE 'Y'.




PROCEDURE DIVISION.
....
PERFORM A1000-OPEN-CURSOR.
PERFORM A2000-FETCH-CURSOR UNTIL WS-DB2-ILF010-OVER
PERFORM A300-CLOSE-CURSOR.


A1000-OPEN-CURSOR SECTION.
A1000-START.
EXEC SQL
OPEN SOICUR
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A1099-EXIT.

A2000-FETCH-CURSOR SECTION.
A2000-START.
EXEC SQL
FETCH SOICUR INTO :WS-POLICY-NUMBER
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN +100
SET WS-DB2-ILF010-OVER TO TRUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A2099-EXIT.
EXIT.

A3000-CLOSE-CURSOR SECTION.
A3000-START.
EXEC SQL
CLOSE SOICUR
END-EXEC.
EVALUATE SQLCODE
WHEN +0
CONTINUE
WHEN OTHER
RAISE AN ERROR
END-EVALUATE.

A3099-EXIT.
EXIT.



In this we declare avariable to identify there is no more row to fetch so whenever it got sqlcode +100 it is setting a flag which is used for looping

Hope it will be helpful
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Sep 06, 2006 8:09 pm
Reply with quote

thanks for the help
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 Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top