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
 

 

How to exclude certain values in Cobol defined 88 level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to exclude certain values in Cobol defined 88 level
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: 686
Location: Earth

PostPosted: Fri Mar 09, 2007 2:33 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Fri Mar 09, 2007 3:20 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Fri Mar 09, 2007 4:42 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Fri Mar 09, 2007 6:00 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Mar 09, 2007 6:16 pm    Post subject:
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    Post subject:
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    Post subject: Re: How to exclude certain values in Cobol defined 88 level
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: 686
Location: Earth

PostPosted: Wed Mar 14, 2007 1:18 pm    Post subject:
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    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
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
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 COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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