Page 1 of 1

Regarding the Linkage Section.

PostPosted: Tue Sep 21, 2010 11:26 am
by prasadnaidu
Hi,

I am calling a sub-program SUB123 from the main-program MAIN123 as shown in below.

CALL 'DEXA0390' USING WS-DISCOUNT-CODE-TABLE
LK-CNT-TOTAL-PRODUCTS
LK-DISCOUNT-CODE-PROMOTION-KEY.

I was declared the sub-program like as shown in below.

PROCEDURE,DIVISION USING LK-PRODUCT-SEG-TABLE
LK-TOTAL-PRODUCTS
LK-CODE-PROMOTION-KEY.

And i was declared the LINKAGE SECTION as below.

01 LK-PRODUCT-SEG-TABLE.
05 LK-PRODUCT-SEG-TABLE-CTR PIC 9(2).
05 LK-PRODUCT-SEG-TAB OCCURS 99 TIMES.
10 LK-KEY-LOCATION-COMMUNICATION PIC 9(18).
10 LK-NUM-SEQUENCE-DOCUMENT PIC 9(2).
10 LK-KEY-CUST-RD PIC 9(11) COMP-3.
10 LK-CODE-LIST PIC 9(1).
10 LK-NUM-PROD-SEQUENCE PIC 9(2).
10 LK-KEY-PROD PIC 9(7) COMP-3.
05 LK-DISCOUNT-CODE PIC X(3).
05 LK-FEEDBACK-CODE PIC X(5).
EJECT

01 LK-CODE-PROMOTION-KEY.
05 LK-PROM-PREFIX PIC 9(9).
05 LK-PROM-BODY PIC 9(8).
05 LK-PROM-SUFFIX PIC 9(10).

01 LK-TOTAL-PRODUCTS PIC 9(4).

The above declaration is not as in the sequence mentioned in the call statement.

My Query is, is it necessary to create the linkage section variables as the order in the call statment or not required?

Could you please share your comments/Thoughts on the same?

Re: Regarding the Linkage Section.

PostPosted: Tue Sep 21, 2010 1:11 pm
by GuyC
as long as the using-clause of both called and calling pgm are the same it is ok.
I vagely recall something that it might be more performant to keep them the same order in LS the same, especially with long using lists. But I don't really see how, so probably I remember wrongly.