Regarding the Linkage Section.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Regarding the Linkage Section.

Postby prasadnaidu » Tue Sep 21, 2010 11:26 am

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?
prasadnaidu
 
Posts: 14
Joined: Fri Aug 14, 2009 10:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Regarding the Linkage Section.

 

Re: Regarding the Linkage Section.

Postby GuyC » Tue Sep 21, 2010 1:11 pm

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.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post