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



Bob P. Roche wrote:
A co-worker had a problem, that I haven't seen before, maybe there is a PTF for it. He has a file with a field defined as 9s 0, we can verify it in 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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.