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

How to exclude certain values in Cobol defined 88 level


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

New User


Joined: 07 Mar 2007
Posts: 5
Location: mumbai

PostPosted: Fri Mar 09, 2007 2:12 pm
Reply with quote

Hi,
How to exclude certain values in Cobol defined 88 level variable having thru series.

For Example
01 My-Variable PIC X(02)
88 LEVEL-1 VALUE 'AA' THRU 'EE'

Now in this definition, I have to exclude 'BB' 'B4' '4D' and so on.

I need a method using any Predefined options.
I don't want to use Redefines Clause.
Thanks,
Prabhu/Anji
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Mar 09, 2007 2:33 pm
Reply with quote

Will this do?
Code:

01 My-Variable PIC X(02)
   88 LEVEL-1 VALUE 'AA' THRU 'EE'.
   88 EXC-LIST VALUES 'BB','B4','4D'.

IN PROCEDURE DIVISION
  IF (LEVEL-1 AND NOT EXC-LIST)
    DO SOMETHING
  ...
Back to top
View user's profile Send private message
anjaneyasastry

New User


Joined: 07 Mar 2007
Posts: 5
Location: mumbai

PostPosted: Fri Mar 09, 2007 2:49 pm
Reply with quote

Thanks for the reply.

Yes that will do.

But i need a single 88 level varialbe concatenating both the conditions.

Regards,
Prabhu/Anji
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Mar 09, 2007 3:20 pm
Reply with quote

It will be gauche..
but still you want it then icon_smile.gif
Code:

    01 TEST-88 PIC XX.                                     
    88 LEV-LIST VALUES 'AA' THRU 'BA','BC' THRU 'B3',   
                         'B5' THRU '4C'.                 
Back to top
View user's profile Send private message
anjaneyasastry

New User


Joined: 07 Mar 2007
Posts: 5
Location: mumbai

PostPosted: Fri Mar 09, 2007 3:33 pm
Reply with quote

Thanks for reply.

But if it is limited breaks i can do the same but there are many limit breaks.

That's why i need some thing like below

01 TEST-88 PIC XX.
88 LEV-LIST VALUES 'AA' THRU 'EE' EXCLUDE 'A1', 'B2','3C' AND SO ON
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Mar 09, 2007 4:42 pm
Reply with quote

88 Levels are meant for program look neat and easy to understand.
why do you want to spoil it ?
Is there any substantial advantage you are getting by making your VALUE clause complex?
Please explain why do you want it in only 'one' 88 level icon_question.gif
Back to top
View user's profile Send private message
anjaneyasastry

New User


Joined: 07 Mar 2007
Posts: 5
Location: mumbai

PostPosted: Fri Mar 09, 2007 5:30 pm
Reply with quote

Yes i agree with you, but the 88 level variable is already existed and used at so many places in the program [nearly 200 places] now we want to exclude some values from the range of values to which 88 level is referencing. If we go to introduce one more 88 level variable with excluding values we have to do code changes at 200 places, it will not be fine right? So we want a solution at the position of 88 level variable only.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Mar 09, 2007 6:00 pm
Reply with quote

Can't you use CHANGE all command in editor to make changes at one go in all 200 PLACES?
I am thinking that you are talking about a single program.
Quote:
01 TEST-88 PIC XX.
88 LEV-LIST VALUES 'AA' THRU 'EE' EXCLUDE 'A1', 'B2','3C' AND SO ON

I don't think you can do that..But try 'Change all' icon_sad.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 09, 2007 6:16 pm
Reply with quote

anjaneyasastry wrote:
So we want a solution at the position of 88 level variable only.
You have been given it, why are you still arguing?
Code:
01 TEST-88 PIC XX.                                     
   88 LEV-LIST VALUES 'AA' THRU 'BA'
                      'BC' THRU 'B3'
                      'B5' THRU '4C'.
Back to top
View user's profile Send private message
anjaneyasastry

New User


Joined: 07 Mar 2007
Posts: 5
Location: mumbai

PostPosted: Tue Mar 13, 2007 7:05 pm
Reply with quote

i know how to use 'change all' . here the question is not using 'change all'
command to change at all the 200 places. i think you doesn't know the answer.
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Tue Mar 13, 2007 8:49 pm
Reply with quote

Could you just clarify?
Quote:

the 88 level variable is already existed and used at so many places in the program [nearly 200 places]


does this mean that it (the 88 level) is

1.referenced in the code 200 times

or do you mean that

2. there are 200 entries in working-storage/linkage sections?

[/code]
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Mar 14, 2007 1:18 pm
Reply with quote

anjaneyasastry wrote:
i know how to use 'change all' . here the question is not using 'change all'
command to change at all the 200 places. i think you doesn't know the answer.

Yes, I don't know that WEARED way. icon_rolleyes.gif Thank god!
I think you are trying to be lazy here. Go and take some efforts.
It's not a big deal.
Important here is to achieve results, not that you should keep cribbing about some minor thing.
I am out of this thread now. icon_mad.gif
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 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top