DO NOT use this tag for Role Playing Games!! RPG (Report Program Generator) is a high-level programming language (HLL) for business applications. IBM is the creator and primary vendor of RPG, but the language is available from other mainframe and microcomputer manufacturers, including Unisys. Use this tag for older non-ILE versions of RPG from IBM and for non-IBM variants of the language.
Questions tagged [rpg]
280 questions
4
votes
2 answers
How to Call RPGIV program from java that returns more than one record
I am calling a RPGIV program from java, the rpgiv program returnes multi record as an output parameter.
I tried the following to return all the rows returned from rpgiv.
// Define Output Data Structure
AS400DataType[] outputData =
{
…

Renier
- 1,738
- 3
- 24
- 51
4
votes
2 answers
Are nulls not permitted in RPG programming?
I've been told by our RPG programmer that none of our AS400-based DB2 database tables can permit nulls because nulls "are really difficult to program for" in RPG. I'd like to know if this is actually true and if so, what is it that makes this…

user1071914
- 3,295
- 11
- 50
- 76
4
votes
2 answers
How can I get the EBCDIC value of a character in RPGLE?
I need to have some way of converting single characters in RPGLE into integers - does anyone know a good way? It has to work for all possible inputs and ideally provide a different integer for each input - at the very least it must provide a…

tarQuils
- 41
- 1
- 2
4
votes
5 answers
How long can memory leaks persist in RPGLE programs?
I'm putting into production some RPGLE code which uses %alloc and dealloc to allocate memory. Programmers should be able to ensure there are no resulting memory leaks but I'm worried about what happens if they don't.
My question is: if programmers…

Tarquila
- 1,167
- 3
- 11
- 17
3
votes
2 answers
Why the OPTIONS(*TRIM) doesn't work as IBM says, what's missing here?
**free
ctl-opt main(main);
dcl-pr main ExtPgm('TSTPGM');
*n char(10) const options(*trim);
*n char(10) const options(*trim);
end-pr;
dcl-pr ExecCmd Extpgm('QCMDEXC');
Command Char(40);
CmdLen Packed(15:5);
end-pr;
dcl-s str0 …

ojay
- 91
- 6
3
votes
1 answer
I have a PF , how to get the list of programs that is using that particular PF?
I have a specific physical file. How do I get a list of programs that is using that PF. Is there any command (or native utility) in AS400 which can fetch that list and give that in an outfile ?

Kunal Roy
- 729
- 3
- 11
3
votes
1 answer
Locking issue with calling programs
I have pgmA which calling by 50 programs.pgmA has detail file in input mode..some of the 50 calling programs has detail file in update mode .as per new requirement, I will get the detail file records in PGMA in XML format..that needs to be breaked…

Sam K
- 103
- 4
3
votes
1 answer
Why is *inlr (last record indicator) switched on at the end of the rpgle program
*inlr (last record indicator) switched on at the end of the rpgle program. What is the main reason for switching on last record indicator. What will happen if this indicator is not switched on.

Kunal Roy
- 729
- 3
- 11
3
votes
1 answer
"Hello world" with ASNA Visual RPG
I am new to ASNA Visual RPG. I spent hours in searching how to print a string in ASNA Visual RPG 9.x. But no luck on finding how to print a simple "hello world" String.
Can someone show me how to print "hello world" in the console?
Example in VB…

EuWern
- 123
- 7
3
votes
2 answers
Why cant I use a Character length more than 65535 RPGIV
I red the following article and it seems like I should be able to define a variable of type varying that's size limit will be 16mb instead of 65535 characters.
http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html
This forum post…

Renier
- 1,738
- 3
- 24
- 51
3
votes
2 answers
How do you define a global variable in a rpg Program that can be accessed in calling functions
RPG on the AS400
Is their a way to define a Global variable that can be accessed by functions inside my main function?
For example I have my main rpg program (Lets call it "MAIN_PROGRAM", inside it I call another RPG program(Lets call it…

Renier
- 1,738
- 3
- 24
- 51
3
votes
3 answers
How to know a program was compiled with ALWNULL(*USRCTL)
I'd need to know how to find that a program was compiled with ALWNULL(*USRCTL) (or whatever which one).
Command DSPPGM doesn't seem to give that info.
We're running V7r1.
Thank you.

Arnaud Mongrain
- 301
- 1
- 2
- 19
3
votes
2 answers
Accept Array of Unknown Size in RPG Procedure
I am trying to make a procedure that will take an array and return a count of the used elements (why is this not a BIF??). I am struggling to find a way to pass an array of unknown size to my procedure.
Something like...
P count B
D count …

Sarah Kemp
- 2,670
- 3
- 21
- 29
3
votes
1 answer
How to declare and call a java method which takes two dimensional bye array parameter from RPG?
I have a java method one of whose arguments is a 2 dimensional byte array (byte[][]). I wanted to call that method from RPG. I know that it works for one dimensional byte array e.g. by declaring that argument in RPG as nA where n is the length of…

tewemit
- 43
- 4
3
votes
3 answers
Java ProgramCall.run hangs
Busy trying to Call RPG function from Java and got this example from JamesA. But now I am having trouble, here is my code:
AS400 system = new AS400("MachineName");
ProgramCall program = new ProgramCall(system);
try
{
//…

ZioN
- 550
- 2
- 11
- 35