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
0
votes
1 answer
How to find TAB in string using %SCAN in RPGLE
How can I use %SCAN built-in function to find first 'TAB' in string ?
I ever read function documentation : https://publib.boulder.ibm.com/iseries/v5r1/ic2924/books/c0925083586.htm
Thanks !

Crunch
- 9
- 4
0
votes
1 answer
How to use RPG program to access DB2 db on IBM system i
I am a newer for RPG program. Now I want use RPG program to access DB2 db on IBM i system. For example insert one record to DB, update one record, delete one record. Could you give some sample code? Thank you very much!

sawyer
- 1
- 1
0
votes
1 answer
RPG - passing DS as arguments to procedure
I wrote a copybook (/COPY) procedure that has this interface:
DCL-PI *N VARCHAR(5000);
FILE_NAME CHAR(10) CONST;
DS_OLD VARCHAR(5000) CONST;
DS_NEW VARCHAR(5000) CONST;
END-PI;
This procedure is called by this sample program.
FILE_DS_* are…

LppEdd
- 20,274
- 11
- 84
- 139
0
votes
2 answers
Call java method from RPGLE (as400)
I need to call a java method from RPGLE, Im getting following error.
I think the way I did prototype the method is wrong.
Cause . . . . . : RPG procedure TESTJ in program TESTLIB/TESTJ received
Java exception "java.lang.NoSuchMethodError: …

yrk
- 67
- 3
- 10
0
votes
1 answer
RPG embedded SQL - Fetching and updating rows
I want to fecth rows and update them in RPG (free).
Using old style opcodes I'd do that:
READE %KDS(KEY) FILE;
processRecord();
UPDATE FILE;
Problems come with SQL opcodes:
EXEC SQL FETCH MYCURSOR INTO :VAR;
processRecord();
????
Using EXEC SQL…

LppEdd
- 20,274
- 11
- 84
- 139
0
votes
2 answers
Is it possible to read content of an IceBreak 'marker' in the program code?
I'm using IceBreak to make HTML frontend for RPG programs.
There is a function called 'SetMarker' which takes the name of the marker and the value:
SetMarker('Demo':'Example');
This makes the value available for the HTML…

aliceraunsbaek
- 625
- 7
- 18
0
votes
2 answers
How to copy a multi occurrence DS to another DS RPG
I am trying to copy a DS to another DS.
D MYRESULTS DS OCCURS(2000)
D QUALIFIED
D PAOPIID 20A
D POPITPE 10A
D POPISTPE …

Renier
- 1,738
- 3
- 24
- 51
0
votes
1 answer
Does scottklement HTTPAPI supports 7zip or any compresion
I am using scottklement HTTPAPI to consume SOAP webservices from the back end RPGIV coding, the webservices is hosted on apache tomcat.
Now some of our xml SOAP is large (400000) characters and would like to use compression for the request and…

Renier
- 1,738
- 3
- 24
- 51
0
votes
4 answers
RPGLE - Write at specific position (RRN) in PF
I need to write a new record at a specific position (ex: 3 out of 20) in a RRN (relative record number) processed PF.
Specifically it's a multi-member PF.
How can I do that?

LppEdd
- 20,274
- 11
- 84
- 139
0
votes
1 answer
Autocomplete Just SQL / RPG and Assembly
So I'm working on implementing an auto-complete search bar and integrating it with an RPG and Assembly system using DB2. I have tried these two techniques to search for distinct IDNumbs from a file, where the input requires at least 3 numbers before…
user1678980
0
votes
5 answers
Copying and Pasting RPG Code
Is there a way to copy and paste RPG code. Like maybe make it into a text file so one can copy and paste? I'm wanting to ask for assistance on a program but am hoping not to have to rewrite the code during the process to do so.
Thank you in advance

rose
- 21
- 1
- 5
0
votes
1 answer
How to call a AS/400 function from a Java Class
I need to call from a Java Class a RPG Function, i found a bunch of examples that show how to do that, but the thing is that my function when is compile is a MODULE not a PGM. And when i try to call it show me a message that the object doesn't…

Daniel Fuentes
- 3
- 5
0
votes
1 answer
How to set a timeout in connect/send ? ( as400 iseries v5r4, rpg )
From this rpg socket tutorial we created a socket client in rpg that calls a java server socket
The problem is that connect()/send() operations blocks and we have a requirement that if the connect/send couldn't be done in a matter of a second per…

David Hofmann
- 5,683
- 12
- 50
- 78
0
votes
1 answer
RPGLE changing the output of a field
I have a field called FNAME which contains the first name of an employee. For my output I want to show only the first letter of their name.
For example, if their name is "Frederic" I want it to output "F" for their first name.
How would I…

Arnatuile
- 185
- 1
- 1
- 5
0
votes
2 answers
Is it possible to create a SQL table on iSeries with record level checking turned off by default?
I'm trying to convert DDS defined tables to DDL without impacting the existing legacy RPG code.
I can do it if I recreate the table in SQL, and then manually turn off the record level checking.
Wondering if the record level check can be turned off…

gfroese
- 58
- 8