IBM Support

2026-07: LIKE(*EXT): Define a variable like one field in an external file

News


Abstract

Information about the PTFs for the ILE RPG enhancement that provides the LIKE(*EXT) keyword to define a single field like an external field

Content

You are in: RPG Cafe 2026-07: LIKE(*EXT): Define a variable like one field in an external file

Short URL: https://ibm.biz/rpgcafe_2026_07_like_one_ext_field

 

2026-07: LIKE(*EXT)

 

Details

With LIKE(*EXT), you can define an item like one field in an external file.

You don't have to define a file or externally-described data structure if you are only interested in one field from the file.

The field is defined exactly the same as the external field with respect to data type, length, CCSID, etc. For external binary types with zero decimal positions, the EXTBININT setting applies.

The simplest form of LIKE(*EXT) just has two extra parameters:

  • The external field name. This can be:
    • The short name (EMPSALARY)
    • The alternate name (EMPLOYEE_SALARY), even if it is quoted ("Employee role")
  • The external file name. This is in the usual forms:
    • 'MYFILE'
    • 'MYLIB/MYFILE'
    • '*LIBL/MYFILE'

 

  • Examples with just the field and file parameters: 

    dcl-s salary like(*ext : 'EMPSALARY' : 'EMPLIB');
    dcl-s name like(*ext : 'EMPLOYEE_NAME' : 'EMPLIB');
    dcl-s role like(*ext : '"Employee Role"' : 'EMPLIB');
    
  • Examples with the optional record format name. It defaults to the first format if there is more than one format in the file. 

         A          R ORDFMT
         A            TYPE          10A  B  5  2
         A          R ITEMFMT
         A            TYPE           5S 0B  5  2
    
    dcl-s order_type like(*ext : 'TYPE' : 'ORDERDSPF' : ÓRDFMT');
    dcl-s item_type like(*ext : 'TYPE' : 'ORDERDSPF' : 'ITEMFMT');
    
  • Examples with length adjustment for string and numeric types. 

     dcl-s bigger_salary like(*ext : 'EMPSALARY' : 'EMPLIB' : +2);
     dcl-s name like(*ext : 'EMPLOYEE_NAME' : 'EMPLIB' : +20);
    

 

.

.

PTFs for 7.5 and 7.6

7.5:

  • ILE RPG compiler: 5770WDS PTF to be announced later
  • CRTSQLRPGI support for LIKE(*EXT): 5770ST1 PTF to be announced later

7.6:

  • ILE RPG compiler: 5770WDS PTF to be announced later
  • ILE RPG compiler, TGTRLS(V7R5M0): 5770WDS PTF to be announced later
  • CRTSQLRPGI support for LIKE(*EXT): 5770ST1 PTF to be announced later
 

RDi support

A later update for RDi will support this enhancement.

 

Documentation

The 7.5 and 7.6 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about this enhancement. Start at the "What's new since 7.5", or "What's new since 7.6" section in the Reference.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"and future releases;7.5.0;7.6.0"}]

Document Information

Modified date:
14 July 2026

UID

ibm17276353