How to transfer link section data to another program link section in COBOL

I am working on a Wrapper / Bridge COBOL program that processes program calls and performs end-to-end operations such as logging, security checking, etc. The main motivation is to check access to security for a consumer program, regardless of whether it has access to a call from a producer program or not.

Let the COBOL bridge program be B1 and the producer program P1 and the consumer (client) C1.

When C1 wants to call P1, he must call B1. Then B1 checks for availability. If C1 has access, then B1 calls P1 with data C1.

C1 -> B1 -> P1 

Here, the communication section of B1 and P1 is the same. Programs use EXEC CICS LINK to call each other.

COMMAREA,

 COMMAREA1 (DataSet Name) 01 COMMAREA-STRUCT, 03 a-field 03 another-field ... 

Customer;

 IDENTIFICATION DIVISION. PROGRAM-ID. Client. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. COPY COMMAREA1 PROCEDURE DIVISION /* fill CommareaStruct with some values. */ .... /* call B1 Bridge */ EXEC CICS LINK PROGRAM (B1Bridge) NOHANDLE COMMAREA (COMMAREA-STRUCT) LENGTH (LENGTH OF COMMAREA-STRUCT) END-EXEC .... 

Bridge,

 IDENTIFICATION DIVISION. PROGRAM-ID. B1Bridge. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. LINKAGE SECTION. COPY COMMAREA1 PROCEDURE DIVISION ... /* access control */ /* logging */ ... /* pass data to P1*/ EXEC CICS LINK PROGRAM (P1) NOHANDLE COMMAREA (COMMAREA-STRUCT) LENGTH (LENGTH OF COMMAREA-STRUCT) END-EXEC .... 

Manufacturer;

 IDENTIFICATION DIVISION. PROGRAM-ID. P1 ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. LINKAGE SECTION. COPY COMMAREA1 PROCEDURE DIVISION .... *doing some business with data in COMMAREA1 ... 

When I try to execute above, I received a compilation warning for Bridge Program B1; "COMMAREA-STRUCT or one of its subordinates was specified, but COMMAREA-STRUCT was a LINKAGE SECTION element that was not targeted. This link will not be resolved successfully when executed."

What does it mean? How do I transfer the B1 binding section to the P1 binding section?

When I try to do this, I got EIBRESP: 22 and EIBRESP2: 26 (network length error) at runtime.

- Change -

I think I should give more detailed information;

Main motivation; In fact, there are two companies - the company COM1 and COM2. COM2 has been an affiliate of COM1 for several years. COM1 and COM2 have CICS1 and CICS2 respectively. And COM2 client programs use COM1 manufacturing programs. COM2 clients never call COM1 manufacturers directly. COM2 clients put data into COMMAREA-STRUCT and invoke the universal Cobol program (let it be GCP) remotely. COMMAREA-STRUCT also has a "manufacturer name" field, which GCP determines which program should be called. Thus, GCP exports the data from COMMAREA-STRUCT and the map to the manufacturer’s fields. GCP performs mapping operations dynamically with addressing (not for every manufacturer). After execution by the manufacturer, GCP takes the result and passes it to the client through COMMAREA-STRUCT. The system was designed this way a few years ago. There are thousands of COM2 customers and thousands of COM1 manufacturers.

enter image description here

Now COM2 wants to be separate from COM1. Thus, COM1 no longer wants to provide full access to all resources (manufacturers) of COM1. Thus, COM1 wants to put new loops before CICS1, which will be a CICS handler that runs only the B1 Bridge program locally. This also applies to network security and political and political decisions.

enter image description here In order to separate companies from each other after a while, neither customers nor manufacturers should be affected. So, the problem should be solved in the GCP-Bridge layer.

That is why the B1 bridge must behave like a GCP for COM2 clients, must check the availability (somehow, we used it) and transfer all the data coming from the clients to GCP without any changes.

Currently, the registration operation has no priority. We will focus a little on companies.

Therefore, I am very grateful for your expert comments.

* We cannot use CALL because B1 will be on another CICS and will not be able to access LOADLIB1 COM1, therefore B1 must delete GCP remotely using EXEC CICS LINK.

* Instead of passing through a comma, channel transmission sounds good to me. We will discuss this.

* By the way, I will check the half-word conflict on LENGHT OF. You're right.

* For security checks, we will discuss "COMPLETE CICS QUICY SECURITY."

* As mentioned above, we cannot modify copies of books. Only we can change

  EXEC CICS LINK PROGRAM (GCP) 

to

  EXEC CICS LINK PROGRAM (B1) 

find and replace on customers. Because thousands of customers. We do not want to change the book and touch them.

In the light of these details, I think the problem is becoming more understandable.

+5
source share
1 answer

In a CICS COBOL program called with EXEC CICS LINK , the communication section must contain a level 01 structure named DFHCOMMAREA . The CICS co-processor precompiler or COBOL compiler will generate the appropriate USING for the Procedure Department so that the program is addressed to the DFHCOMMAREA structure.

DFHCOMMAREA will contain the contents of what you call COMMAREA-STRUCT when you LINK in the target program.

One way to deal with a situation where you will find yourself to change your notebook to remove the name of the level 01 structure and require all customers to encode their own name of the level 01 structure immediately before the COPY instruction. In bridges and producer programs, this level 01 structure name will be DFHCOMMAREA .

Another way to deal with this situation is to abandon LINK in favor of dynamic CALL . You must include DFHEIBLK as the first CALL parameter.

Another way to deal with this situation is to discard messages for one or more CICS containers. Instead of passing COMMAREA to LINK you would go through a channel, the channel will have one or more containers hanging from it, containing the data you want to transfer.

Something to watch out for, you are using the special LENGTH OF register for your length. Special case is a complete word, but the length parameter for a comma is a halfword. I suspect this will cause you grief unless IBM creates the code to intercept this particular idiom and moves the special register to a temporary half-layer (unlikely, but possible).

Update:

From your additional information, it’s obvious that your task is to write a “replacement replacement” for an existing program (GCP).

A pragmatic approach can create a new notebook, let it be called COMAREA2, which is a copy of COMAREA1, but without the built-in name of the level 01 structure. Place the COPY COMAREA2 instruction immediately after the structure name DFHCOMMAREA 01 in program B1.

This is not ideal, as it should be clear somewhere in the documentation that changes to the COMAREA1 textbook should be reflected in COMAREA2. Of course, a manual process like this introduces the possibility of error, but it really helps you modify any of the C1 or P1 programs.

More elegant, if it works for you, it would be a try ...

 COPY COMAREA1 REPLACING == 01 COMMAREA-STRUCT== BY ==*01 COMMAREA-STRUCT==. 

... in your program B1. This would eliminate the need for the COMAREA2 notebook proposed above. If this works, you simply place the COPY statement after the structure level name DFHCOMMAREA 01.

+7
source

All Articles