×
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.
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 from
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
anymore.
I really like to find where this is described in the RPG Reference book: I
couldn't find it at all.
This page describes the defaults for the internal format of numeric
definitions:
https://www.ibm.com/docs/en/i/7.5?topic=formats-internal-format
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;
end-ds;
dcl-ds myds;
salary like(myfile_types.salary);
...
end-ds;
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.