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
0
votes
2 answers

Go to wrksplf after exit from DSPF?

I'm creating a screen designer on iSeries 400 [IBM] The RPGLE program that I create I'm trying to find out what will be the command to let the user be in the wrksplf after they exit from the program (press F3 that I create indicator) in CLLE I can…
Ali
  • 9,997
  • 20
  • 70
  • 105
-1
votes
0 answers

RPGLE (Chain) From one Subfile calling another same subfile (Chaining again)

I am scratching my head trying to solve this issue. I have a two subfiles. Basically what i'm trying to achieve is to select a record from the subfile with an option. This will then call another program which is basically a copy of the previous…
-1
votes
1 answer

Problem with RPG Prototype for java.io.File

I'm attempting to work with jsoup in RPGLE, but I don't know a lot about Java. I can't get past trying to create a java.io.File object to use in jsoup. I'm obviously doing something wrong, but I just can't seem to figure out what. Here's my code: …
Rob Schember
  • 206
  • 1
  • 3
-1
votes
1 answer

CRTBNDRPG - Few clarifications regarding RPG Compiler Listing (SPLF)

Q1: On line 1, i know 5770WDS is Rational Development Studio for i and V7R3M0 is the OS version, what does 160422 and RN represents? Q2: Why DBGVIEW(*STMT) says '(Source not available.)' and isn't producing any debug view? Q3: How does the use of…
ojay
  • 91
  • 6
-1
votes
0 answers

Strikethrough a word in AS400 print report

How to print a strikethrough word in as400 report? I couldn't even replicate overprinting report in QSYSPRT. OQSYSPRT E 01 O A2 9 O A3 9 O A4 …
El Khan
  • 15
  • 6
-1
votes
1 answer

Convert a DS from fixed to free form in RPGLE

I have the following data structure in an old program D P1PARM DS 256 D P1ADFR 1 15 D P1ADTO 16 30 D P1MSNR 31 37 0 D P1NSNR 38 44 0 D P1YEAR …
Kunal Roy
  • 729
  • 3
  • 11
-1
votes
2 answers

Syntax errors in RPGLE program

I am creating a RPG program (In PUB400 server) that simulates an ATM cashier with some options. This RPG program uses three tables as: Customers(Id, Name, RegistrationDate), Accounts(AccountNumber, CustomerId, Balance) and Transactions(Id,…
reymagnus
  • 327
  • 2
  • 17
-1
votes
5 answers

What is usually preferred in a sub-proc, INZ during variable declaration or using CLEAR?

Assuming both choices will yield same results, what choice do you usually make and why? dcl-proc test_proc ; ... dcl-s count int(5) inz ; ... // use count end-proc ; or dcl-proc test_proc ; ... dcl-s count int(5) ; ... …
ojay
  • 91
  • 6
-1
votes
4 answers

CRTSQLCI v RUNSQLSTM

I am running this on OS 7.4. CREATE PROCEDURE MYLIB.MYSQLPROCEDURE1(PARM1 IN INT) LANGUAGE SQL SPECIFIC MYQ001 BEGIN …
jemrug
  • 89
  • 10
-1
votes
1 answer

Need any or IBMi API to validate address existence

I am in search of an IBMi API that could validate existence of an address, I am not sure if there is any native IBMi API that can do this, since all my search has exhausted. I tried looking at validateaddress api provided by google, but am not sure…
mrsorrted
  • 141
  • 1
  • 8
-1
votes
1 answer

KD_raj185 rpgle code in as400 try this please

an assignment operator is expected with the eval operation a semi colon is not specified at the end of a free format statement the name or indicator is not defined the compiler cannot determine how the program can end try this please hope its…
-1
votes
2 answers

How to read RPGLE source code into a variable in another program

How can I read RPG source code into a variable in another RPG program? This is so I can analyze the code to edit it.
-1
votes
1 answer

Excel Print-Papersize in RPGLE (Apache POI)

i try to setup the papersize to print my Excel with the Scott Klement - Excel-Tool. Unfortunately I don't know how to do this correctly. I have an HSSF source where the Java methods are defined. In the RPGLE program, I then call them up accordingly…
-1
votes
1 answer

How to fetch multiple records from a fetch statement in SQLRPGLE?

Recently in an interview I was asked how to fetch multiple record using a single fetch statement in SQLRPGLE. I would like to know is it possible to get multiple record using a single fetch statement, if yes then can some one elaborate?
Kunal Roy
  • 729
  • 3
  • 11
-1
votes
1 answer

I am getting a wrong content assist in RPGLE program in visual studio. Can anyone tell me what am I doing wrong?

RPGLE program in Vs code I have enabled all the required extensions in vs code for RPGLE language support. Extension "RPGLE language tools" is supposed to show content assist for fully free format programs but it is showing me something else.