Just to be clear, the fix here was not to add "ext" to the declaration.
The fix was to remove "*all" from the "extname" definition.
This will work with SQL:
This will not work with SQL RPGLE as it does not understand any of the EXTNAME modifiers.
The "ext" declaration has the only added impact of allowing the name of the data structure to be the name of the File.
Allowing you to possibly omit the extname definition.
From the ILE RPG Reference:
The EXT keyword is used in a free-form data structure definition to indicate that the data structure is
externally-described. If the EXTNAME keyword is not also specified, the name of the data structure is
used to locate the external file that provides the subfield definitions.
If the EXT keyword is specified, it must be the first keyword.
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Filip Drzewiecki
Sent: Thursday, August 30, 2018 12:43 AM
Subject: Re: Long names and Data structures based on SQL Table problem
Adding ext to declaration has helped!
You are great :)!
śr., 29 sie 2018 o 23:33 Arco Simonse <arco400@xxxxxxxxx> napisał(a):
The following code compiles well on my system:
dcl-ds myTable ext extname('ADMINMAS') qualified alias;
dcl-ds myTable_X likeds(myTable);
SELECT * INTO :Mytable_x
WHERE Administration_Id = 1;
Make sure that your filename is in uppercase when you use quotes, and
you will need the keyword EXT preceding to the EXTNAME keyword.
Hope that helps.