COBOL: “service reload”

I have a really old cobol program generated under VS cobol. Under 3.2 VS cobol no longer works. I regenerated the program to view the problems and a line 'Service Reload' came up as invalid. What does Service Reload do? Is there an 'easy' replacement?

Answer Wiki

Thanks. We'll let you know when a new response is added.

“SERVICE RELOAD” updates an address pointer used internally by Cobol programs for Linkage Section items. These pointers are called “BLL Cells”. This stands for “Base Locator for Linkage Section”.

As you know, 01-levels in Linkage Section are not arranged in contiguous blocks of storage, as is the case in Working Storage. Each 01-level can point to any valid starting address in memory.

So, for example, if we have two 01-levels in Linkage Section:
01 FIELD-A .
01 FIELD-B PIC X(100).

There will be one BLL cell for FIELD-A, and one for FIELD-B. They can point to very different blocks of memory.

Let’s say that you are “playing games” with the BLL cells as a way of performing a programming trick. For example, you add 2 to the BLL Cell that is used for FIELD-A. (The actual technique for doing this varies depending on the version of Cobol).

Now, if you refer to SUB-FIELD-1 e.g.:
you will actual move spaces to SUB-FIELD-2 !

However, in the older versions of Cobol, this will only happen if you code SERVICE RELOAD FIELD-A before the MOVEstatement. SERVICE RELOAD forces Cobol to look at the value in the BLL Cell again, and use the now-current value (incremented by 2) as the base address for the 01 level. Not surprisingly, Cobol normally performs an optimization in the code, and only looks at the value in the BLL Cell once — it is not expecting us to perform this memory trick. We have to code SERVICE RELOAD to force Cobol to use the new value in the BLL Cell for calculating addresses.

As far your question of how to replace SERVICE RELOAD when it is flagged as a compile error, I would have to advise you to proceed cautiously here.

My advice is to display the value of the special register ADDRESS OF FIELD-A, both before and after the code that modifies the BLL Cell. (This code is probably in an Assembler Language subroutine.) You want to make sure that the value of ADDRESS OF FIELD-A is incremented.

This programming trick was widely used in CICS/Cobol programs, for reasons having to do with the definition of multiple duplicate lines on a BMS screen.

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: