Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Constants in EXTNAME are incorrectly treated as literal file names #177

@FraGag

Description

@FraGag

According to the documentation for EXTNAME:

  • In a free-form definition, the file-name and format-name parameters must be character literals or named constants representing character literals. If a parameter is a named constant, the constant must be defined prior to the definition statement.
  • In a fixed-form definition, the file-name and format-name parameters can be either names or character literals.

Source Orbit doesn't handle this distinction correctly; it uses the "fixed-form definition" semantics even in free-form definitions.

Steps to reproduce

  1. git clone https://github.com/IBM/ibmi-company_system.git
  2. git checkout c94ca30387de18f0d28af5f5669849c1773cfd76
  3. so -- This should output nothing.
  4. Apply the following patch:
diff --git a/qrpglesrc/depts.pgm.sqlrpgle b/qrpglesrc/depts.pgm.sqlrpgle
index 37b5f5c..7deb695 100755
--- a/qrpglesrc/depts.pgm.sqlrpgle
+++ b/qrpglesrc/depts.pgm.sqlrpgle
@@ -54,7 +54,8 @@
       *
           Dcl-S Index Int(5);
 
-          Dcl-Ds Department ExtName('DEPARTMENT') Alias Qualified;
+          Dcl-S C_Department 'DEPARTMENT';
+          Dcl-Ds Department ExtName(C_Department) Alias Qualified;
           End-Ds;
 
           
  1. so -- This now outputs:
qrpglesrc/depts.pgm.sqlrpgle:57 - No object found for reference 'C_DEPARTMENT'

It's interpreting C_DEPARTMENT as the file name, instead of as a constant name that needs to be looked up and resolved, yielding DEPARTMENT as the file name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions