VALUE Clause!!



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

Re: VALUE Clause!!

Postby bhumireddy564 » Fri Oct 22, 2010 2:37 pm

how can i use the condition code 88 effectively
bhumireddy564
 
Posts: 3
Joined: Fri Oct 22, 2010 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: VALUE Clause!!

 

Re: VALUE Clause!!

Postby Robert Sample » Fri Oct 22, 2010 3:15 pm

88 condition variables help reduce complexity of comparisons. For example, use
15  WS-IN-STATE PIC X(02).
    88  SOUTHERN-STATE VALUE 'GA', 'TN', 'FL', 'SC', 'NC', 'VA', 'AL', 'MS', 'TX', 'LA', 'AR'.
which allows you to use
IF  SOUTHERN-STATE
instead of
IF  WS-IN-STATE = 'GA' OR 'TN' OR 'FL' OR 'SC' OR 'NC' OR 'VA' OR 'AL' OR 'MS' OR 'TX' OR 'LA' OR 'AR'
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post