IBM Support

SAMEPOS keyword for 7.3 with a PTF

General Page

You are in: RPG Cafe > SAMEPOS keyword for 7.3 with a PTF

Short URL:

RPG Cafe: SAMEPOS keyword for 7.3

New SAMEPOS keyword for the ILE RPG compiler in 7.3

  • PTF SI69572 for 7.3 is available.


  • ILE RPG compiler: SI69572


Brief description of the SAMEPOS keyword

SAMEPOS(other_subfield) positions the new subfield at the same position as the parameter subfield. The new subfield must follow the SAMEPOS subfield in the data structure.

Unlike the OVERLAY keyword, the subfield defined with SAMEPOS doesn’t have to fit within the overlaid subfield.

dcl-ds ds1 qualified;
   x char(10);
   y char(20) overlay(x); // Invalid: Y does not fit in X
dcl-ds ds2 qualified;
   x char(10);
   y char(20) samepos(x); // Valid. Y starts at position 1, the same position as X

RDi support

RDi supports the SAMEPOS keyword starting in version

Documentation in the IBM Knowledge Center

The ILE RPG Reference and ILE RPG Programmer's Guide in the 7.3 and 7.4 IBM Knowledge Center are updated with full information about the SAMEPOS keyword. Start at the "What's New Since 7.3" or the "What's New in 7.4" section in the Reference.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"Component":"ILE RPG Compiler","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
11 December 2019