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



All,

My modernization pilot project ran into another snag and I wondered whether
anyone else has been here before and would mind telling me how they solved it.

Situation:
The DB was designed using then-current as/400 best-practices - consistent and
extensive use of REFFLD and the old "2 plus 4" field naming convention where each
file was assigned a unique 2-char prefix. This ensured that all field names were
unique across the DB, but that similar fields shared the same 'root'.

The pilot project has redefined several files with the DDL 'create table' and a
new column-naming convention where similar data-items are named the same. The
original 2plus4 field names were retained with the 'for column' keyword for
compatibility with existing code. Consider the following:
CREATE TABLE CUSTOMER_LIST (
CUSTOMER_ID FOR COLUMN CUCUID CHAR(10) CCSID 37 NOT NULL DEFAULT '' ,
NAME FOR COLUMN CUNAME CHAR(30) CCSID 37 NOT NULL DEFAULT '' ,
ADDR FOR COLUMN CUADDR CHAR(30) CCSID 37 NOT NULL DEFAULT '' ,
CITY FOR COLUMN CUCITY CHAR(20) CCSID 37 NOT NULL DEFAULT '' ,

CREATE TABLE WAREHOUSE_LIST (
CUSTOMER_ID FOR COLUMN WHCUID CHAR(10) CCSID 37 NOT NULL DEFAULT '' ,
WAREHOUSE_ID FOR COLUMN WHWHID CHAR(10) CCSID 37 NOT NULL DEFAULT '' ,
NAME FOR COLUMN WHNAME CHAR(30) CCSID 37 NOT NULL DEFAULT '' ,
ADDR FOR COLUMN WHADDR CHAR(30) CCSID 37 NOT NULL DEFAULT '' ,
CITY FOR COLUMN WHCITY CHAR(20) CCSID 37 NOT NULL DEFAULT '' ,

Problem:
The designers of the DSPF compiler made an... well, let's call it an
"unfortunate" choice. Instead of honoring the actual field name in cols. 19-28 of
the DSPF source, they chose to retrieve the column's DDL name instead. So in the
example above, if a DSPF shows the 'customer address info' at the top of a panel
and the 'warehouse address info' in the body of the panel, the DSPF compiler now
throws CPD5237 errors at me, complaining that the 'CITY' column is specified more
than once.

Solution:
One solution is to append an ALIAS keyword to each offending DSPF field, but
since DSPF compiler won't allow the ALIAS value to be the same as the DSPF field
name, it becomes necessary to devise up to three names for each field: a standard
name on the DDL (CITY), another in cols. 19-28 of the DSPF (WHCITY) and yet a
third value for the DSPF ALIAS keyword. This seems like a lot of work for no good
reason since the RPG compiler doesn't give a fig _what_ the ALIAS value is - it
uses the old system name.

I've not been able to find a DSPF compiler option or other keyword to address
this. Am I missing something obvious or must I write a program to automatically
insert an ALIAS behind each and every DSPF field?

Many thanks, JK
---- Msg sent via Internet America Webmail - www.internetamerica.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.