Skip to main content

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
Why not just use COPY REPLACING?

In your example you would say:

COPY 'INPUT.WS' REPLACING ==MAX-RECORD VALUE 20==
BY ==MAX-RECORD VALUE 5000==

We do a lot of this.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
That's a good idea. We've used copy/replacing to change field name prefixes in FD copybooks, but I never even considered the possibility of being able to use it for this.

Thanks
brad

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
One caveat.

When you use COPY ... REPLACING, the listing and debug source do not contain the REPLACEd text. This can be very confusing.

I have complained about this to Acu support but they refuse to acknowledge it as a bug or even a problem.

I have generic procedures that I COPY into a program several times, changing the name in each. However, in the listing they all look exactly the same.

In other words, there is no way for you to check that your COPY ... REPLACING has actually worked unless you test it in the actual program when it is running. E.g. in my example above, you would have to check programmatically that the 78 value had been changed to 2000.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
One caveat.

When you use COPY ... REPLACING, the listing and debug source do not contain the REPLACEd text. This can be very confusing.

I have complained about this to Acu support but they refuse to acknowledge it as a bug or even a problem.

I have generic procedures that I COPY into a program several times, changing the name in each. However, in the listing they all look exactly the same.

In other words, there is no way for you to check that your COPY ... REPLACING has actually worked unless you test it in the actual program when it is running. E.g. in my example above, you would have to check programmatically that the 78 value had been changed to 2000.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
One caveat.

When you use COPY ... REPLACING, the listing and debug source do not contain the REPLACEd text. This can be very confusing.

I have complained about this to Acu support but they refuse to acknowledge it as a bug or even a problem.

I have generic procedures that I COPY into a program several times, changing the name in each. However, in the listing they all look exactly the same.

In other words, there is no way for you to check that your COPY ... REPLACING has actually worked unless you test it in the actual program when it is running. E.g. in my example above, you would have to check programmatically that the 78 value had been changed to 2000.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
With version 7.0 and higher there is a listing option -lp

called preprocessing, this will indeed process the copy replacing statements and write thiem to the listing.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
Ha, Ha! That's funny! :D

Their initial argument against this was that no other compiler did it.

But I countered that with the explanation that the GNU C compiler could output the results of the pre-processor with a specific compile switch.

I never heard back from them after I pointed that out. That was about 2 or 3 years ago.

Looks like they had a rethink! :p

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
We asked for the copies to expand into the listing and debug code over 5 years ago... no interest/response.... Until now.

In the 7.0 preprocessed code:
Do 78 level constants show as their name or their constant value?

Do you know if the pre-processed code is what shows in the debugger?

This has always been a pain, that you can't tell when debugging what value was used for a 78 level constant. and you have to manually type names in the debugger to display anything from replaced procedural code.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
We asked for the copies to expand into the listing and debug code over 5 years ago... no interest/response.... Until now.

In the 7.0 preprocessed code:
Do 78 level constants show as their name or their constant value?

Do you know if the pre-processed code is what shows in the debugger?

This has always been a pain, that you can't tell when debugging what value was used for a 78 level constant. and you have to manually type names in the debugger to display anything from replaced procedural code.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
We asked for the copies to expand into the listing and debug code over 5 years ago... no interest/response.... Until now.

In the 7.0 preprocessed code:
Do 78 level constants show as their name or their constant value?

Do you know if the pre-processed code is what shows in the debugger?

This has always been a pain, that you can't tell when debugging what value was used for a 78 level constant. and you have to manually type names in the debugger to display anything from replaced procedural code.

[Migrated content. Thread originally posted on 17 February 2006]

Does anyone know if its's possible to override a 78 level's value at compile time?

For example (in a copy file named INPUT.WS)

78 MAX-RECORD VALUE 20.
77 INPUT-REC PIC X(MAX-RECORD) VALUE SPACE.

which would be used the majority of the time.

There could be an exception however where 1 program needs a 5000 byte data item. It would be great if I could do something like
78 MAX-RECORD 5000.
COPY "INPUT.WS"

and have the value defined in the program override what is in the copybook.

Any way to accomplish this?

Brad
I believe that the preprocessed code is in the listing and in the object file but that is not applied to the source code that you see in the debugger.