Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Cobol Level Number 88

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Cobol Level Number 88
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    Post subject:
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    Post subject: Re: Level 88.
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    Post subject:
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    Post subject:
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    Post subject: Re: Cobol Level Number 88
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    Post subject: HOW TO USE SET WITH CONDITION CODE
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: 1187
Location: Bangalore,India

PostPosted: Thu Aug 31, 2006 1:00 pm    Post subject:
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    Post subject: Re: Cobol Level Number 88
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us