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

Return dsply message from a rpgle pgm to a cl variable

I have a cl program thats call rpgle program. The rpgle program produces a dsply "message" I want to set the dsply message as a variable in the cl program used to call the rpgle pgm. What cl command to retrieve the dsply message to a variable?
As4rikru
  • 35
  • 3
-1
votes
3 answers

Has anyone tried using docuSign with the IBM i (aka iSeries, AS400)?

I am trying to be able to call the API for DocuSign and ROOMS for real state from our IBM i using RPGLE. I have not been successful. If someone has been able to accomplish this, can you share?
Cardenej
  • 29
  • 2
-1
votes
2 answers

Comment in RPG?

I would like to put in comment several lines. In the documentation, we can use this -> (/*...*/) https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzajp/rzajpcommentsirpg.htm I tried several times but it does not work. /* dsply 'Enter your…
user13829429
-1
votes
1 answer

Resuing HTML IFS file in Iseries

I am a using webpage with method. In the html form i have used POST method which is calling an RPGLE program and by using CGI libraries i am retrieving the values in my RPGLE program. Once i retrieve the value in program i want to show the same…
-1
votes
1 answer

How to query a table in Fixed format RPG and check record with if-condition?

So, say a table ##TAB has one column #VALUE which contains 'SDM' & 'LB' as entries. The column size is 12 characters. I want to query the table using Fixed-Format RPG and compare it later in IF condition. The logic is simple but I'm not sure about…
Harsh Arora
  • 214
  • 2
  • 10
-1
votes
1 answer

How to delete a record from a subfile in RPGLE when the record is not already written on to a Physical file

How to delete a record from a subfile in RPGLE, the record is not written on to a Physical file, so deleting the record from the PF and reloading the subfile will not do, is there any other way to achieve this?
Kunal Roy
  • 729
  • 3
  • 11
-1
votes
1 answer

How to execute a db2 query with a where condition using runqry command in CL/400

I was trying to execute a IBM DB2 query using runqry command of CLLE, but was unable to do it as it contained a where condition and I was unable to define a host variable in the runqry command. Can this be done by using the runqry command without…
yuvi
  • 13
  • 3
-1
votes
1 answer

How to check if specific version of IBM i supports Fully free RPG?

V7R1M0 is the version I see in spool files generated in the IBM i server used in my company. Does this version support fully free RPG flavor where even F and D specs can be written in free format? How can this be found out? I have copy pasted few of…
-1
votes
2 answers

Using cursor for multiple search conditions

To begin with I want to apologise for my bad english and it's possible that I miss some crucial information for you guys. Anyways. I am developing a display file with a subfile to show some records. It works like a charm when showing one select but…
Jegge
  • 9
  • 5
-1
votes
2 answers

In DB2, i need to select rows from a single column based on the value of a host variable

In DB2, i need to select rows from a single column based on the value of a host variable. The db column can contain a 'D' or 'P' only. The host variable can contain the value 'D' or 'P' or 'B' (all rows). When the host variable is a 'D', I…
cubswin
  • 11
  • 3
-1
votes
1 answer

sqlrpgle dynamic query in as/4000

I have employee1 table with field student_id,name,marks and table with field name,suppose NEHA is present in name field,I have a table with name NEHA .In name table marks,id and subject field is there.I want to fetch subject from name table(neha)…
Nabamita
  • 1
  • 2
-1
votes
1 answer

better way to code this loop

HI I have a program that used to get some data from a shipping system, that has been replaced. the previous code chained to the shipping system with Company Order# Release# getting these from the order detail table. Note that orders can have…
user3167167
  • 93
  • 2
  • 9
-1
votes
2 answers

RPG get SFLSCROLL from mutiple format DSPF without responce wait

In RPGLE I'm try to get the SFLSCROLL from a DSPF with multiple formats displaying. I used a read of the SFLCTL to get the SFLSCROLL but the screen is waiting for a response. How can get it to return to the program without the wait?
-1
votes
1 answer

how to change output mode to input mode (fields)in updating the database file using rpgle as400

I've written a program in #rpgle along with the 2 records work screen in display file. First record will display the main-screen-of-company, which takes input as: emp id indicators= f3: exit f6: accept. After pressing the f6, it goes to the…
-2
votes
0 answers

I am not able to push my new local branch from RDi software to Github though the initial connection is successful

Below are the steps I followed: Cloned my Github repository in RDi git perspective. Able to successfully connect to it by providing my Github authentication ID and password. Created a new project in iProject perspective and associated that with my…
1 2 3
45
46