Thread: PL/I

STRUCTURE alignment when passing to COBOL linkage section

Started by James • user4 replies165 viewsLast activity 1 month ago
Post #1
0 votes
James
Reputation
524
Posts: 8
Joined: May 2, 2024, 8:00 AM
Posted: May 25, 2026, 8:54 AM

Good morning,

We are integrating a PL/I pricing module with an existing COBOL order entry program. The PL/I structure is declared as:

pli
DCL 1 PRICE_REQ BASED(REQ_PTR),
      2 PRODUCT_CODE  CHAR(12),
      2 REGION_CODE   CHAR(3),
      2 ORDER_QTY     FIXED BIN(31),
      2 REQUEST_DATE  CHAR(8);

The COBOL copybook uses aligned elementary items with equivalent picture clauses. Initial testing shows REGION_CODE is offset by two bytes in the COBOL view.

The Enterprise PL/I Programming Guide states:

Structure alignment and padding depend on compiler options and subscript bounds. Verify layout with LISTVIEW or equivalent when interfacing with non-PL/I programs.

Has anyone established a standard approach for generating shared copybooks or layout proofs between PL/I and COBOL on z/OS?

Regards,
James

Post #2
0 votes
Marty
Reputation
412
Posts: 15
Joined: Aug 12, 2024, 9:14 AM
Posted: May 25, 2026, 1:54 PM

We run LISTVIEW on the PL/I side and compare against a COBOL compile listing with MAP. Differences are resolved in a shared layout document before any production bind. Do not assume CHAR alignment matches without proof.

Post #3
0 votes
James
Reputation
524
Posts: 8
Joined: May 2, 2024, 8:00 AM
Posted: May 26, 2026, 11:54 AM

We will schedule a layout proof session. If padding cannot be eliminated, is prefixing a version byte in the structure acceptable for forward compatibility?

Post #4
0 votes
Marty
Reputation
412
Posts: 15
Joined: Aug 12, 2024, 9:14 AM
Posted: May 26, 2026, 5:54 PM

Yes. We use a one-byte layout version as the first field in all cross-language structures. Callers check it before interpreting the remainder.

You must be signed in to reply to this thread