You may try the following:
dcl-ds LabelName ;
Arr Like(XRLA01) Dim(3) Pos(1);
Mit freundlichen Grüßen / Best regards
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Sent: Dienstag, 12. September 2017 18:44
To: RPG <rpg400-l@xxxxxxxxxxxx>
Subject: Auto load an array when reading a record.
i'm pretty sure i have seen this done but,
I'd like to read a record, and automatically populate an array. I know it
can be done with the old syntax with beginng and ending positions because i
have old examples of it in the source here but i would like to do it using
newer syntax and as gracefully as possible.
My current example (i have had many variations) won't compile but i think it
gives the gist of what i am trying to do, which is automatically load the
LabelName array upon read of the file xrcl01.
A successful example of what i am trying to do would be appreciated.
dcl-f XRCL01 usage(*input ) keyed ;
// File layout for xrcl01
// XRCUST customer number (key)
// XRLSTM last maint date
// XRLA01 label name 1 char(8)
// XRLA02 label name 2 char(8)
// XRLA03 label name 3 char(8)
// XRSET1 label 1 sets dec(2:0)
// XRSET2 label 2 sets dec(2:0)
// XRSET1 label 3 sets dec(2:0)
dcl-ds LabelName dim( 3) ;
XRLA01 pos( 1) ;
XRLA02 pos( 9) ;
XRLA03 pos( 17) ;
chain 039356 XRCL01 ;
*inlr = *on;
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: