× 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: RPG Standards?
  • From: "James W. Kilgore" <qappdsn@xxxxxxxxxxxxx>
  • Date: Thu, 16 Dec 1999 11:48:47 -0800
  • Organization: Progressive Data Systems, Inc.

I love standards, there's so many to choose from :)

What we have found, in our establishment of standards, is that every choice is 
a tradeoff of
efforts.  Making a different choice is not necessarily a better choice, it just 
introduces a
different set of additional considerations.

Our rules started with the file names and commands and filtered down to 
record/field/subroutine
names.

We started with IBM's guidelines for words.  Tossing out vowels.  After trying 
it out (back under
RPGIII) we came up with our own set of rules:

If the subject is a single word (Item, Customer, Vendor, Employee) we use the 
first 4 letters.

If the subject is two words (Sales Order, Purchase Order, Item Balance) we used 
the first letter of
the first word, the first three letters of the second word, so we get SORD, 
PORD, IBAL.  This gave
us our command names. And so some extent our physical file names.  ITEMPF, 
IBALPF, then we got SHDR
and SITM as topics to the subject SORD, and exceptions crept in.

Once we established the subject/topic/file names we associated a two letter 
mnemonic to each
(IM=Item Master, IB=Item Balance, etc.) and these became the first two letters 
of the files field
names and the first two letters of the subroutine names. (IMGET, IMINZ, IMREAD, 
etc.)

Once this was done, we worked on our data dictionary.  So we could define ITEM 
as a generic field
for item code, then use REFFLD for each usage of ITEM.  IMITEM, IBITEM, etc. 
but we got lazy and
only did this in the dictionary if the rules were different than the standard 
definition.  Otherwise
the physical file definition makes a reference to ITEM.

The record name could be as simple as adding an 'R' to the file name (ITEMR, 
IBALR, etc.)

Joined logicals are the primary subject and the secondary mnemonic (so joining 
the Sales Item with
the Item Master became SITM@IM, record name SI@IMR)

>From this point, we get down to code snippet styles.  We like using the primed 
>DOW loop for reads.
Other shops don't.  We're not afraid of MR. Other shops forbid it. Whichever 
construct is decide
upon, IMO, uniformity is more important that the actual construct itself.

The use of template programs and /COPY are a nice coercive technique.  The 
project manager or
programmer may start with a template program that contains stuff like:

    F$$$$DSPF
    F$$$$KEY
....
    D/COPY $$$$RPGD
    C/COPY $$$$KLST
....
    C    $EXIT    DOWNE 'Y'
    C             WRITE ##EDTHDR
    C             EXFMT ##EDTDTA
    C/COPY $TIMEDOUT
....
    C        EXSR ##GET
....
    C/COPY $$$$GET
    C/COPY $CF03
    C/COPY $CF12
....

With a little scan/replace of $$$$ with ITEM and ## with IM, the programmer can 
concentrate on
solving the problem, not structuring the program.  The same holds true for the 
DDS.

But this is just the tip of the iceberg, we have plenty of other standards.  
And -lots- of
templates.






>
>
> CBeck@good-sam.com on 12/16/99 11:00:46 AM
>
> Does anyone have a list of naming standards, or just programing standards 
>that they use for RPG?
> I am trying to set up a list of standards to follow.  Any help would be 
>greatly appreciated.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 ...

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.