|
On 2020-03-10 9:38 a.m., Mónica Anastácio wrote:
Well after this morning meeting, im allowed to find a new solution not
based in what we used to do i fexed format. But the new solution has work
with “Pointers” if anyone can help me. I really appreciate it 😉
Mónica,
Joe Pluta already showed an example of how to do this using pointers.
Here is the code that Joe posted.
dcl-ds er5005ds extname('ER5005DS') based(per5005ds) end-ds;
dcl-pi *n;
i_er5005ds like(er5005ds);
end-pi;
per5005ds = %addr(i_er5005ds);
That method allows you to use the subfields of er5005ds with just the
subfield names (addr, id_no) instead of coding er5005ds.addr,
er5005ds.id_no).
Did you mean that you want a new solution to work _without_ pointers?
If that is what you meant, then I think the best way is to code like
this. (I believe other people have already recommended this method ...)
dcl-ds er5005ds_t extname('ER5005DS') qualified template end-ds;
dcl-pi *n;
er5005ds likeds(er5005ds_t);
end-pi;
But now, you have to code the subfields of the parameter as qualified
names.
if er5005ds.addr = *blanks;
...
--
Barbara
--
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@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
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.