Questions tagged [rpgle]

RPGLE is a high-level programming language (HLL) for business applications for programs running in the Integrated Language Environment (ILE). IBM is the creator of RPGLE. Use this tag for all questions about RPG IV and free format RPG. Use the RPG tag for questions about older versions of RPG and non-IBM variants of the language.

The latest version of RPG is RPG IV (aka ILE RPG) on IBM's Power i servers; it inherits the System i Integrated Language Environment’s features such as prototyped functions and procedures, static and dynamic binding, access to C routine libraries, dynamic link libraries, and fully recursive and re-entrant modular code.

RPG (also called RPG IV and RPGLE) is a popular programming language of the IBM Power i platform. Originally created as a report writer tool to replicate card processing on the IBM System/3 in the early 1960s, RPG has since evolved into an HLL equivalent to COBOL and PL/I.

An RPG program typically starts off with File Specifications, listing all files being written to, read from or updated, followed by Data Definition Specifications containing program elements such as Data Structures and dimensional arrays, much like a "Working-Storage" section of a COBOL program or var statements in a Pascal program. This is followed by Calculation Specifications, which contain the actual meat of the code. Output Specifications can follow which can be used to determine the layout of other files or reports. Alternatively files, some data structures and reports can be defined externally, mostly eliminating the need to hand code input and output specifications.

In the early days of RPG, its major strength was known as the program cycle: every RPG program executes within an implied loop, which can apply the program to every record of a file. At that time each record (individual punched card) would be compared to each line in the program, which would act upon the record, or not, based upon whether that line had an "indicator" turned "on" or "off" — from a set of logical variables numbered 01–99 for user-defined purposes, or other smaller sets based upon record, field, or report processing functions.

Alternatively, the cycle can make an interactive program continue to run until explicitly stopped.

Today, most RPG programmers avoid using the cycle in favor of controlling the flow of the program with standard looping constructs. The concept of level breaks and matching records is unique to the RPG language. It was originally developed with card readers in mind.

686 questions
12
votes
4 answers

RPG to Java migration on an IBM iSeries

Our company uses an IBM iSeries for a majority of our data processing. All of our internal apps are written in RPG. According to IBM's roadmap, IBM is pushing companies to move to Java/J2EE. We're looking to modernize our internal apps to a more GUI…
Bill Martin
  • 4,825
  • 9
  • 52
  • 86
11
votes
1 answer

Deployment automation of RPGLE with Gradle on IBM i

Does anyone have an expertise on building IBM i software: rpgle, sqlrpgle, clle programs, srvpgms with gradle? The idea for now is: all source code stored in git repo jenkins ci, integrated with git, pulls software update there is a json file in…
9
votes
2 answers

What's the difference between EVAL and MOVE in RPGLE

I recently got into the IBM's RPG world, so while writing some code and reviewing other people's code I've found that some use Eval and some others use Move to accomplish the same things. Is there any difference between them? Thanks.
Sebastian
  • 845
  • 4
  • 12
  • 25
7
votes
1 answer

How can I avoid unexpected procedure name conflicts in service programs?

Using concepts learned from the famous IBM Red Paper on RPG Exception and Error Handling, I have written a service program QGPL/ERRFUNC to implement reusable error functions like Assert, Throw, ThrowMsg, Rethrow, and GetErrorMsg. I have been using…
Mike
  • 1,274
  • 10
  • 24
7
votes
3 answers

What's the correct way to check sql found condition in ILE RPG?

When working with embedded SQL in RPG, you often end up with a cursor and a dow-loop for processing all rows in your result. The condition in the loop is somehow dependent on SQLCOD and/or SQLSTT, some globally available variables in an…
kratenko
  • 7,354
  • 4
  • 36
  • 61
7
votes
4 answers

Source Control on the IBM i (iSeries)

On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible.
Mike Wills
  • 20,959
  • 28
  • 93
  • 149
7
votes
2 answers

How do I iterate over a set of records in RPG(LE) with embedded SQL?

How do I iterate over a set of records in RPG(LE) with embedded SQL?
nearly_lunchtime
7
votes
2 answers

Automated testing in RPG (or other ILE languages)

we have quite a lot of RPG-programs here, and we do a lot of automated testing, but we are not very good yet in combining those two. Are there good ways to do automated testing on RPG programs -- or on any other ILE programs for that matter? I am…
6
votes
1 answer

How do you organize your RPGLE subversion repository on IBM i?

How do you organize your RPGLE subversion repository on IBM i ? I'm currently working in a travel business company that has a vast amount (about 13k) of RPGLE - sources for their in-house application and finally they want to use version control and…
squarefox
  • 232
  • 1
  • 7
6
votes
4 answers

How to get psds informations in c++

With the ILE compiler, in RPG, you can use the PSDS to get information about the current user, job name etc.. How do you get the same information in a C++ program, using ILE?
Arsnow
  • 161
  • 1
  • 13
5
votes
3 answers

Fully free RPG data structure

I came across the below code in a fully free RPG program. dcl-ds *N; *N char(2) inz('PR'); //STR0037123 - start *N char(2) inz('ER'); *N char(2) inz('MP'); *N char(2) inz('PC'); *N char(2) inz('PT'); *N char(2)…
Theju112
  • 185
  • 7
5
votes
1 answer

Program need to return array data structure elements back to the program where it's called t

I have the requirement where I need to return array data structure elements back to calling program .initially I thought of using array data structure (9999- max dim) as parameter to calling program..there are 50 calling programs are there .only…
Sam K
  • 103
  • 4
5
votes
1 answer

What is the best IDE to use for programming in RPGILE for the AS/400 ? Can you connect to a 400 using Visual Studios IDE?

What is the best IDE to use for programming in RPGILE for the AS/400 ? Can you connect to a 400 using Visual Studios IDE? I'm a C# programmer who fell in love with Visual Studios and also am a lot younger than allot of the folks who have been…
Yusha
  • 1,496
  • 2
  • 14
  • 30
5
votes
2 answers

Extend Templated Data Structure (Inheritance)

I have been reading about LIKEDS, TEMPLATE, and BASED trying to determine if there is a way to create data structure templates (prototypes) with inheritance. I have: D costs DS QUALIFIED TEMPLATE D material …
Sarah Kemp
  • 2,670
  • 3
  • 21
  • 29
5
votes
3 answers

RPGle - i wish i could do some 'Reflection' using RPGLe

I wish i could do some reflection using RPGLe. By reflection, I mean : 'The process or mechanism of determining the capabilities of an object at run-time.' Imagine you have this datastructure : D DS_Format DS Qualified…
Charles Martin
  • 420
  • 4
  • 12
1
2 3
45 46