I am a software engineering student. I would like to develop a minimal set of requirements for variable naming conventions. To put it in simple words, if we are to declare a variable what should be the properties that the name of the variable should possess?
What I do are a couple of things. First, I create all my database field names using a 2 digit file prefix. For example, if I am creating a field in order header (OHEADER) and the field is a customer number I name it OHCUST. The OH is for the file ID (OH)EADER and CUST for customer name. Now when I create a holding field for OHCUST I remove the file ID, OH, and replace it with an @ sign like @CUST. This way I know the variable of @CUST is a program defined field and it holds the customer number with the same attributes of OHCUST. As for work variables like a do I want to print a record, I will name it @PRINT defined as 3A and move in either "Yes" or "No " into the field. The rule is to keep things simple so you know what they mean. How they are defined is not important as long as you know they contain the data you want. I hope this helps.
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.
Dig Deeper on RPG iSeries programming
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.