|
As Jon Paris noted, the rules for EXTNAME are different for fixed vs
free format:
• 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.
In Mohan's original question it's unclear whether the parameter for
EXTNAME is the actual name of the file, or the name of a character
field. Note that in free-form, the parameter for EXTNAME cannot be the
name of a character field; if it's not a character literal, it must be
the name of a named constant representing a character literal.
As Brian noted, this would work:
DCL-DS DS_WMS0104 EXTNAME('LMBJDS104W') PREFIX('W_') END-DS;
or
DCL-C LMBJDS104W CONST('LMBJDS104W');
DCL-DS DS_WMS0104 EXTNAME(LMBJDS104W) PREFIX('W_') END-DS;
But this wouldn't work because the named constant must be defined before
it's used:
DCL-DS DS_WMS0104 EXTNAME(LMBJDS104W) PREFIX('W_') END-DS;
DCL-C LMBJDS104W CONST('LMBJDS104W');
And this wouldn't work because the parameter for EXTNAME, if it's not a
character literal, must be the name of a named constant, not a field.
DCL-S LMBJDS104W CHAR(10) INZ('LMBJDS104W');
DCL-DS DS_WMS0104 EXTNAME(LMBJDS104W) PREFIX('W_') END-DS;
--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx
pdow@xxxxxxxxxxxxxx /
On 4/26/2024 12:51 PM, Brian Parkins wrote:
Nearly. Needs quotes around the EXTNAME item, i.e. ExtName('LMBJDS104W')--
From the RPG IV Reference:
"• 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."
On 26/04/2024 19:30, Peter Dow wrote:
Something like
DCL-DS DS_WMS0104 EXTNAME(LMBJDS104W) PREFIX('W_') END-DS;
or
DCL-DS DS_WMS0104
EXTNAME(LMBJDS104W)
PREFIX('W_')
END-DS;
--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx
pdow@xxxxxxxxxxxxxx /
On 4/26/2024 11:13 AM, Mohan Eashver wrote:
Happy Friday to you, how are you?
Will you please recommend a Free RPG syntax for the below ?
* D DS_WMS0104 E DS EXTNAME(LMBJDS104W) D
prefix('W_')*
----
Regards,
Mohan Eashver
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.