Add 88 Level Variable outside Copybook?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Kedar Afley
New Member
Posts: 5
Joined: Mon Apr 28, 2014 9:17 am

Add 88 Level Variable outside Copybook?

Post by Kedar Afley »

Hi,

I've a COPYBOOK like this -

Code: Select all

01 COPYBK-IND. 
    05 COPYBK-CURRENCY. 
        10 COPYBK-STATE-CURRENCY    PIC X(01). 
            88 COPYBK-CURR-A      VALUE 'A'. 
            88 COPYBK-CURR-B      VALUE 'B'. 
            88 COPYBK-CURR-C      VALUE 'C'. 
    05 COPYBK-OTHER 
         10.....
Now I need to add a 88 level variable without changing the copybook

Code: Select all

88 COPYBK-CURR-D      VALUE 'D'.
Please let me know if there is any simple way to do this.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Add 88 Level Variable outside Copybook?

Post by William Collins »

Onnly by dfining another field, putting the 888 on that, and MOVEing COPYBK-STATE-CURRENCY to it. Why can't you change (or arrange to be changed) the copybook?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Add 88 Level Variable outside Copybook?

Post by Robert Sample »

Copy books are used as they are -- you can't really change them, so what you are asking (a simple way to change it) does not exist.

Your options are:
1. Change the copy book
2. Create a new copy book with the additional conditional
3. As stated, move the variable to another variable in your program and put the 88 conditional on the variable in your program.

Changing the copy book would be the easiest way.
Kedar Afley
New Member
Posts: 5
Joined: Mon Apr 28, 2014 9:17 am

Re: Add 88 Level Variable outside Copybook?

Post by Kedar Afley »

William:

I'm testing a change and was thinking to add an aaditional variable for testing for future, left in the program as a comment. The value of the variable would change frequently for testing.

Robert:

Thanks. I shall check if I can change the copy book and keep the new variable as comment until we finalize on the values to be used finally.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”