Usage of level 88



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Usage of level 88

Postby yousufroushan » Wed Jun 23, 2010 6:09 pm

How can we use level 88 n if we have a more than one value for a conditional name how to set a default value for it.
yousufroushan
 
Posts: 8
Joined: Wed Jun 23, 2010 5:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Usage of level 88

 

Re: Usage of level 88

Postby Robert Sample » Wed Jun 23, 2010 6:33 pm

If you search the COBOL Language Reference manual for the VALUE clause (section 5.3.18.2 to be precise), you will find that these are valid:
88  COND-1 VALUE 01 THRU 25.
88  COND-2 VALUE 05 10 15, 20, 25, 30.
88  COND-3 VALUE 01 THROUGH 10, 15, 20 THRU 30
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Usage of level 88

Postby yousufroushan » Thu Jun 24, 2010 2:47 pm

Thanks Robert. But, If i want to set a default value for it, other than the first value, do i need to use SET statement?
yousufroushan
 
Posts: 8
Joined: Wed Jun 23, 2010 5:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Usage of level 88

Postby Robert Sample » Thu Jun 24, 2010 5:03 pm

You cannot set a default value for an 88 level. The 88 level is associated with a variable and you can use a VALUE clause on that variable to define the initial or default value.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Usage of level 88

Postby dick scherrer » Thu Jun 24, 2010 11:25 pm

Hello,

But, If i want to set a default value for it, other than the first value
If you want to set a default value on a field in the program simply code VALUE 'whatever' on the statement that defines the field (rather than the level 88). Assuming the default value should be 25, something like:
05 some-nbr pic 99 value 25.
   88  COND-2 VALUE 05 10 15, 20, 25, 30.


Possibly i misunderstand. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post