For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2004 > Re: Data Name = to more than one number









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Data Name = to more than one number
Michael Mattias

2004-03-26, 10:59 pm

> "KL" <klbjornme@aol.com> wrote in message[color=darkred]
> news:e7ccb54b.0402092010.1baa8164@posting.google.com...


EVALUATE ORDER-ITEM-SERIES
WHEN "1" THRU "2"
DO THIS
WHEN "3"
WHEN "4"
WHEN "5"
alternate to "3" THRU "5"
WHEN OTHER
PERFORM OH-MY-GOODNESS-AN-UNEXPECTED-VALUE
END-EVALUATE

MCM


Chuck Stevens

2004-03-26, 10:59 pm

I haven't seen the original message; I'm citing from Michael's response.

There's also the (very) old-fashioned way, using "abbreviated combined
relation conditions":

IF ORDER-ITEM-SERIES = '1' OR '2'
PERFORM FIRST-DISC
ELSE IF ORDER-ITEM-SERIES = '3' OR '4' OR '5'
PERFORM SECOND-DISC.

Note that the first END-IF in the example has a period after it, which means
that the second one should receive a syntax error. And as presented
there's a missing OR after '4'.

Note also that I'm not a fan of abbreviated combined relation conditions,
but they have been a supported feature of COBOL for a very, very long time
and, carefully used, they can be useful.

-Chuck Stevens

"Michael Mattias" <michael.mattias@gte.net> wrote in message
news:f3s3c.32217$PY.28391@newssvr26.news.prodigy.com...
>
>
> EVALUATE ORDER-ITEM-SERIES
> WHEN "1" THRU "2"
> DO THIS
> WHEN "3"
> WHEN "4"
> WHEN "5"
> alternate to "3" THRU "5"
> WHEN OTHER
> PERFORM OH-MY-GOODNESS-AN-UNEXPECTED-VALUE
> END-EVALUATE
>
> MCM
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com