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


  • Subject: Re: qualifying datanames
  • From: Pete Hall <peteh@xxxxxxxxxx>
  • Date: Thu, 31 Dec 1998 23:44:26 -0600
  • In-Reply-To: <43CD2BEE0479D211A75C00A0C9E1C83603DFF6@PROTEUS>

At 11:10 12/31/1998 -0600, Mary Koetting wrote:
>We're a couple of COBOL programmers converting RPG code. We standardized our
>datanames because we thought that was 'good'. We are used to qualifying
>datanames in COBOL and didn't think what it would do to the RPG code.
>
>Is there a way of qualifying names in RPG IV? I think the list has already
>answered this as a 'no' but I wanted to double check.
>
>Working on the assumption that you can't, what's the best way to make sure
>that we are getting the value of variable that we expect? Should we save the
>value and use the new named variable? We don't have the time or the
>expertise to change the flow of the chains/reads.

The usual way to do it in RPG is to declare the base definitions in the
field reference file and prefix them to make them unique in each PF DDS.
All fields reference the definitions in the FRF. In RPG IV, you also have
the option of declaring a data structure based on a physical file and using
the PREFIX keyword to insert a unique prefix on each field name. The files
must be defined as program described files if you do this, you can't use
key lists (you use a data structure for the same purpose if you have
compound keys - the key fields need not be contiguous in the record). All
the op codes are the same as for externally described files. You just
specify the data structure as the target of CHAIN or READ, and the source
for WRITE and UPDATE by placing its name in the operation spec's result
field. You end up with fields like IM_PRODID, OL_PRODID defining product ID
in two different data structures. You can even move one data structure to
another, but this is usually frowned upon in RPG, as it can lead to
problems if one data structure changes. RPG doesn't have a MOVE
CORRESPONDING operation. Your method will work too, although personally I
think the prefix method referencing the FRF makes it easier to identify the
base definition.

hth
Pete
Pete Hall
peteh@inwave.com
http://www.inwave.com/~peteh
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@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-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.