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

How to update a file using a CURSOR in SQLRPGLE

Can someone tell me how to update a data using the CURSOR in sqlrpgle.Is there a way updating data just by using CURSOR rather than using the Update statement in SQLRPGLE?
Kunal Roy
  • 729
  • 3
  • 11
-2
votes
1 answer

Calc Date in RPG with parm from a CL program

I would like to build a function that calculate a date. I have a CL program that calls a RPG program with a parameter The calculation i want to do is if i send in the parm 00000000 (yearmonthdays) nothing happends. the function returns todays date…
As4rikru
  • 35
  • 3
-2
votes
1 answer

YAJL JSON PARSING

I am trying to parse below JSON using YAJL. YAJLGEN generated below data structure but the issue i am facing is the number of arrays ex: KEY, CUSTOMER are not fixed. These arrays are returned for each field in the response. I am trying to avoid…
Rob
  • 1
-2
votes
1 answer

GUI for RPGLE Webservice Development on iseries OS V7R1

I am researching the best GUI interface to deploy to developer laptop(s) to develop and deploy RPGLE webservice processes on an iseries currently running OS V7R1. We have future plans to migrate to OS V7R2 or V7R3 but are currently limited to the…
-2
votes
1 answer

RPG exec sql works only once

I wrote program in RPG IV free-form and i met a problem. Im trying to execute sql statment with: dcl-proc getRecord; dcl-pi *N int(5) end-pi; dcl-s rec int(5) inz(0); exec sql select max(SCORE) into :rec from SNK_HISC; return rec; END-PROC; It…
Silver
  • 3
  • 4
-2
votes
1 answer

recursive run of rpg program

i am running a rpg program recursively it is giving an error like this Application Error. RNX8888 unmonitored by PGM1 at statement *N, instruction X'0000'. Trigger program or external routine detected an error.....what can be the resolution ...its…
abhinav singh
  • 856
  • 6
  • 23
  • 45
-2
votes
1 answer

Accessing RPG / .PGM command language (CL) syntax within qshell

This question pertains to the i5/OS (mainframe, as400, etc.) and its programs that are written in CL. How does one access the parameters within a given .PGM extension file (RPGLE) outside the application itself and without admin privs? I have tried…
Singularity20XX
  • 321
  • 5
  • 20
-3
votes
1 answer

Packaged Data Free-form RPG

I'm in Charge of an IBM i Series. Now I have to program some new things. I have to read some data from an internally described file and use it in my program but it contains packed decimal data and I'm not quite sure how to handle that. How do I…
Scrober
  • 13
  • 5
-3
votes
2 answers

I am new to AS400 and i want to know how can i give input at the run time in rpgle?

I want to convert temperature from Fahrenheit to Celsius. At run time it should ask the temperature in Fahrenheit and then show the the equivalent temperature in celsius.
-3
votes
2 answers

Code is not incrementing locations needed

I have an sqlrpg program which is supposed to generate warehouse locations, 8 positions, in a loop so that we will have rows, aisles,bins, as: but code is only producing the first row below, and is in a 'never ending loop. Now this below code is the…
-4
votes
1 answer

s multi dimensional array from RPGLE (AS400) to java

I have tried many times to pass a multi dimensional array from rpg(AS400) to java,but it didn't works, Is there any possibility to pass multi dimensional array fromRPGLE (AS400) to java can some one help.
1 2 3
45
46