View previous topic :: View next topic
|
Author |
Message |
anjaneyasastry
New User
Joined: 07 Mar 2007 Posts: 5 Location: mumbai
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
anjaneyasastry
New User
Joined: 07 Mar 2007 Posts: 5 Location: mumbai
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
It will be gauche..
but still you want it then
Code: |
01 TEST-88 PIC XX.
88 LEV-LIST VALUES 'AA' THRU 'BA','BC' THRU 'B3',
'B5' THRU '4C'. |
|
|
Back to top |
|
|
anjaneyasastry
New User
Joined: 07 Mar 2007 Posts: 5 Location: mumbai
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
Back to top |
|
|
anjaneyasastry
New User
Joined: 07 Mar 2007 Posts: 5 Location: mumbai
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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' |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
anjaneyasastry
New User
Joined: 07 Mar 2007 Posts: 5 Location: mumbai
|
|
|
|
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 |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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. 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. |
|
Back to top |
|
|
|