The RPG IV programming language allows you to do many different types of operations on your data. Operation codes, entered on the calculation specifications, indicate what operations will be done. For example, if you want to read a new record, you could use the READ operation code. The following is a list of the types of operations available.
Example of an ILE RPG Program
This section illustrates a simple ILE RPG program that performs payroll calculations.
The payroll department of a small company wants to create a print output that lists employees’ pay for that week. Assume there are two disk files, EMPLOYEE and TRANSACT, on the system.
The first file, EMPLOYEE, contains employee records. This shows the format of an employee record:
DDS for Employee physical file
The second file, TRANSACT, tracks the number of hours each employee worked for that week and any bonus that employee may have received. This shows the format of a transaction record:
DDS for TRANSACT physical file
Each employee’s pay is calculated by multiplying the ″hours″ (from the TRANSACT file) and the ″rate″ (from the EMPLOYEE file) and adding the ″bonus″ from the TRANSACT file. If more than 40 hours were worked, the employee is paid for for 1.5 times the normal rate.
Example of an ILE RPG Program
Today's date will be printed in day, month, year format with ″/″ as the separator.
File Description Specifications
There are three files defined on the file description specifications:
Using the definition specifications, declare a variable called ″Pay″ to hold an employees’ weekly pay and two constants ″Heading1″ and ″Heading2″ to aid in the printing of the
The coding entries on the calculation specifications include:
The output specifications describe what fields are to be written on the QSYSPRT output:
The subprocedure calculates the pay for the employee using the parameters passed to it. The resulting value is returned to the caller using the RETURN statement.
The procedure specifications indicate the beginning and end of the procedure. The definition specifications define the return type of the procedure, the parameters to the procedure, and the local variable Overtime.
IBM - RPG Related Interview Questions
|IBM-ILE Interview Questions||IBM Informix Interview Questions|
|IBM DB2 Interview Questions||SQL Database Interview Questions|
|IBM AIX Interview Questions||SQL Interview Questions|
|AS400 Interview Questions||DB2 SQL Programming Interview Questions|
|IBM Integration Bus Interview Questions||Synopsys Interview Questions|
|Rpgle Interview Questions|
Ibm - Rpg Tutorial
Overview Of The Rpg Iv Programming Language
Rpg Programming In Ile
Program Creation Strategies
Creating An Application Using Multiple Procedures
Using Source Files
Creating A Program With The Crtbndrpg Command
Creating A Program With The Crtrpgmod And Crtpgm
Creating A Service Program
Running A Program
Calling Programs And Procedures
Rpg And The Ebusiness World
Obtaining A Dump
General File Considerations
Accessing Database Files
Accessing Externally Attached Devices
Using Workstn Files
Example Of An Interactive Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.