× 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.

Thank you for your replies!
@Barbara Yes, I got to the very same conclusion, even though this is not
clear at all in the RPG reference.

Happy new year!

Il giorno mer 4 gen 2023 alle ore 00:07 Barbara Morris <bmorris@xxxxxxxxxx>
ha scritto:

On 2022-12-28 9:56 a.m., Maria Lucia Stoppa wrote:
I have got news!

It looks like free RPG doesn't support DS subfields with the same name of
file's fields either: it derives the subfield length from the database
field but not the data type.
If a DS is created containing the very same STRNUM and STRNAM names as
the previous example, then the internal file field's variable is stil
packed(5:0) whereas the DS subfield is zoned(5:0).
So, using DS simply to group fields doesn't seem possible in free RPG

I really like to find where this is described in the RPG Reference book:
couldn't find it at all.

This page describes the defaults for the internal format of numeric

If you code a data structure with just the names of the
externally-described fields, the numeric subfields will be zoned.

If you want the subfields to have the same data type as the external
fields, you need to code a separate externally-described data structure
to get the exact types.

In the following example, if the SALARY field in MYFILE is packed, then
the SALARY subfield in the MYFILE_TYPES and MYDS data structures will
also be packed.

dcl-ds myfile_types extname('MYFILE') qualified template;

dcl-ds myds;
salary like(myfile_types.salary);


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

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 thread ...


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

This mailing list archive is Copyright 1997-2023 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.