Home > Ask the AS/400 Experts > iSeries Systems Management Questions & Answers > RPG programming standards
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

RPG programming standards

Tim Granatir EXPERT RESPONSE FROM: Tim Granatir

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 27 March 2001
I am looking for documentation relating to RPG Programming Standards that have been incorporated and proven. We are looking to setup and refine our current standards, they are very outdated. We were hoping to find more up-to-date examples of good programming standards for a small RPG programming shop.


>

I don't know of any central source for RPG programming standards. I know of few technical subjects that stir stronger passions than the subject of programming standards. There always seems to be two camps, those who want little to no standards, and those who want to make a rule for everything. Programming standards are individualized per IT shop and are somewhat affected by the type of company you work for. You should develop standards that are right for your shop and organization. I generally favor making programming standards for the important things and keeping the list small enough that people can remember them. Attached is a partial list of some things you may want to consider along with some notes that may serve as food-for-thought.

Object naming conventions-- Do you have a naming scheme for Physical files, field names, logical files, RPG program setc?

File definitions -- External or program described, do you use a field reference file, Do you key physical files or only logical files, etc.?

Subfile processing -- How do you build and process your subfiles? (There are at least three primary ways to build and process them.)

Guidelines on Coding Style

Record locking -- How to avoid or deal with record lock issues?

Reports-- Definition of standard report headings and trailers. Are print files externally described, or program described?

Standard error message handling--Do you use a message file for error messages, or are they program described ?

Work management/security-- What does your standard library list structure look like, etc.?

CRT screen design standards--For Green Screen applications, SAA standards are the norm.

Standard function key definitions-- For Green Screen applications, SAA standards are the norm.

Standard option definition--For Green Screen applications, SAA standards are the norm.

Also, here are a few coding style guidelines to consider that are hopefully not too controversial.

** Text will be provided in the beginning of every program describing its function and purpose.

** When modifying an existing program or file, maintain a modification log in the header of the source that contains your name, the date of change and the description of the change.

** Document for clarification and readability; do not over-document.

** Write all programs using modern structured programming techniques.

** Format a program to help the reader understand it.

** Modularize, use subroutines.

** Use descriptive variable names.

** Limit the size o nested DO loops and IF statements Less nesting is usually better.

** When commenting out executable code, use more than 1 asterisk to make it more obvious that the code is no longer executable A minimum of four asterisks is recommended.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Systems Management
Transfer files from one environment to another without closing all other AS/400 sessions
Send a *LMSG successfully on AS/400 using the SNDDST command
Extend storage capacity on an IBM i without negatively effecting system performance
Configure the iSeries v5r4 to open the HTTPS port for incoming connections
Changing system CCSID
Changing user password expiration
Detecting system changes made by outside IP address
HIPER PTF installation and cover letters for SF99097
Library QUSRSYS not completely installed
SQL statement history storage

Performance
Will overloaded discs impact iSeries performance?
Extend storage capacity on an IBM i without negatively effecting system performance
Database drivers on the i: MySQL vs. IBM Toolbox
Performance tuning for IBM i: The basics and beyond
IBM releases new Power products for the midrange
Top System i admin tips for 2006
Catholic Charities keeps track of homeless with iSeries
i5 error messages: What you need to know
IBM races for clock speed
System shutting down after cleanup

iSeries system performance and monitoring
Translating Linux for IBM i admins: Working with jobs and networking
Database performance comparisons on IBM i
How to: Monitoring job activity on the AS/400
Performance tuning for IBM i: The basics and beyond
How to: Reduce the percentage of ASP used on the AS/400
Detecting system changes made by outside IP address
AS/400 system values quiz
Checking on System i disk space requires creating a new command: XRTVSYSSTS
Drive space management commands
Viewing netstat information

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
CIW  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts