|
Bob P. Roche wrote:
A co-worker had a problem, that I haven't seen before, maybe there is a
itPTF for it. He has a file with a field defined as 9s 0, we can verify
listin several places.
Yes. This is the way RPG works. It converts all numeric fields from
files into packed (unless you tell it not to.) That way, you can use
the same field names in multiple files, and they'll all have the same
definition.
For example, if you have a CUSTMAS (Customer Master) file and a DDS
display file that's intended as a place to edit the customer master
record. You can use the same field names in the display file as you do
in the CUSTMAS record. So you don't have to manually move every field
from CUSTMAS to the display... you can just read the CUSTMAS file, and
it'll automatically populate the display fields.
The same works for any type of file (display, printer, database,
communications, tape, etc). So you can read a record from one file and
write it to another.
The idea is to convert everything to a common format -- to facilitate
this idea of sharing fields between files.
This is the way that RPG has worked since RPG III was introduced on the
S/38.
Note that if you declare an external data structure, or you read your
database file into a data structure, the rules change. When you do
this, RPG will stop trying to convert things to packed, and will use the
same definition that's in the database.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.