You are in: RPG Cafe > SAMEPOS keyword for 7.3 with a PTF
Short URL: http://ibm.biz/rpg_samepos_keyword
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;
y char(20) overlay(x); // Invalid: Y does not fit in X
dcl-ds ds2 qualified;
y char(20) samepos(x); // Valid. Y starts at position 1, the same position as X
RDi supports the SAMEPOS keyword starting in version 184.108.40.206.
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.
- 7.3 Reference: What's new since 7.3: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/rpgrelv7r3post.htm
- 7.4 Reference: What's new in 7.4: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasd/rpgrelv7r4.htm
11 December 2019