× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



+1

I hated having to use LikeDs for the purpose of nesting - but it was preferable to not being able to do it!

Jon P

On Aug 14, 2024, at 5:06 PM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2024-08-03 8:21 a.m., myibmi via RPG400-L wrote:
I recommend to work whenever possible with templates.
Example with your data:
dcl-ds xmldata;
file_in like t_file-in dim(100);
cnt_file-in int(5);
end-ds;
dcl-ds t_file_in template;
dcl-ds header;
dcl-subf file_number int(5);
end-ds;
service like tsf_service;
end-ds;
...

I think you meant to use LIKEDS, not LIKE.

With LIKE, file_in would be a CHAR subfield, not a sub-data-structure.

But aside from that, it's interesting that you prefer templates. One of the reasons we added nested data structures to RPG was because it could be difficult to understand complicated data structures for XML-INTO when the final data structure definition was spread out over several small data structures.

So, for me, the only time I would use a template for one of the nested data structures would be when I actually wanted the smaller data structure for something else, like a parameter for a procedure that only handled some small part of the data.
--
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@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.