2,862 questions
1
vote
1
answer
54
views
Issue Using JSON_TABLE with CLOB in IBM i COBOL
I am encountering an issue when using JSON_TABLE in IBM i COBOL with CLOB data. Below is an example of the code I am using:
EXEC SQL
DECLARE C_EMP CURSOR FOR
SELECT U.FIRSTNAME, U.PHONETYPE
...
1
vote
1
answer
95
views
SQL JSON_OBJECT in RPGLE Character conversion is not defined
I try to make a JSON_OBJECT in my SQLRPGLE Program. But even the simplest doesnt work:
**FREE
ctl-opt dftactgrp(*no) actgrp(*caller);
dcl-s PAYLOAD varchar(1000);
EXEC SQL
SELECT CAST(
...
0
votes
0
answers
45
views
How do I wire up opening a text document in visual studio using Code for IBMi connection
From the following link https://codefori.github.io/docs/dev/api/
I am developing my own VS Code extension and want to interact with the active IBM i connection, so I can use the API provided by Code ...
0
votes
3
answers
74
views
How to detect if a Display File (DSPF) needs recompilation after a Physical File (PF) change in IBM i?
I'm developing a tool program on IBM i that automates recompilation of objects (RPGLE, DSPF, CLLE) whenever changes occur. Everything works fine for RPG and CLLE, but I'm struggling with detecting ...
2
votes
2
answers
139
views
AS400 - DB2 list all the dataq
Quite new to this AS400. I've tried this code and it works to list all the files:
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
FROM QSYS2.SYSTABLES
WHERE TABLE_SCHEMA = 'QGPL'
ORDER BY TABLE_NAME
...
0
votes
2
answers
70
views
remove unwanted characters in PF on AS400
I want to remove (not replace) unwanted characters in AS400 (IBMi) tables coming from external (un-manageable) text documents uploaded into AS400.
Using RPGLE, RPGLE/SQL or CL if possible
On AS400 PF ...
1
vote
2
answers
104
views
SAX XML API program on IBM i ends prematurely after ~889570 records with no error — how to debug and trap errors?
I'm working with an RPGLE program on IBM i (AS/400) that uses the QxmlSAXParser_parse_systemid() API to parse large XML files stored in the IFS.
🔧 Environment:
IBM i v7.3
RPGLE (ILE), compiled with ...
0
votes
1
answer
122
views
Add a field with sequence number based on RRN?
Question specifically for AS400, DB2
I have a file called RECIPES with no key. Example
Recipe Number/Ingredient number/Ingredient Qty/Sequence No
1000 111211 Sugar 0
...
1
vote
3
answers
270
views
Calling AS400 RPG program with complex Data Structure from a .NET 8 application
I'm working on a business application modernization project where I need to call existing AS400 programs (RPG, CLP ...) from a .NET 8 app.
These RPG programs have I/O parameters with complex Data ...
2
votes
1
answer
149
views
Creating a SQL table function for RPGLE program
I have an existing RPGLE program on IBM I which I call from ACS "Run SQL Scripts" like this:
CALL F60PTF.COINPRQ(1, 1, 'CHAI11', '258', 1, 'LB', '', 'MAIN');
WRKOBJ OBJ(COINPRQ) returns the ...
1
vote
2
answers
113
views
Why is SNDPGMMSG not showing messages in a subfile when called from a procedure instead of a subroutine in RPGLE?
I'm a beginner learning RPGLE and display files on IBM i. I’ve created a program that displays a message using a message subfile (SFLMSG) when calling a CL program (MSGSFLCL) via a subroutine, and it ...
0
votes
2
answers
68
views
RPG/DDS - display subfile and message queue subfile on same page?
re: RPG/DDS - display subfile and message queue subfile on same page
When one screen has both display subfile and message queue subfile.
Program does two reads (or exfmt). User has to press enter ...
0
votes
1
answer
101
views
Iseries, acs and external stored procedures. So where's my LDA?
On our Iseries machine we have a routine which returns some information regarding the status of a third party package, it tells us if it's up or down (it's Sage if you're really interested)
I've ...
0
votes
1
answer
81
views
ISeries RPGLE simulate keystrokes
In a RPGLE I'm receiving information from a PC program, to prompt the program the user has to press Ctrl-Alt-A. Before that can be loaded they use F2 to clear the fields for the data to be entered ...
-2
votes
1
answer
69
views
Is there a way to disassemble an IBM i RPG program or module to expose added cycle code? [closed]
I am trying to see what code the RPG compiler adds to cycle-enabled programs to do the implicit reading/writing of primary/secondary files. I tried various DBGVIEW options during compilations but so ...
2
votes
4
answers
225
views
RPG: begsr vs dcl-proc
I made small change in program that sends program messages (SNDPGMMSG) to message subfile in RPG program. Change was converting subroutines to procedures.
I changed one subroutine to dcl-proc from sub-...
0
votes
3
answers
372
views
CALL QSYS2.QCMDEXC AS400
I'm trying to run the command from .NET C# using non-query SQL commands on the AS400.
CALL QSYS2.QCMDEXC('CPYSPLF FILE(AUMENTO1) TOFILE(*TOSTMF) JOB(557767/RAB/AUMENTO1) SPLNBR(1) TOSTMF(/REPORTES/...
0
votes
3
answers
99
views
RPG DDS screen - capture function key (F1, F05) value
I am having trouble capturing value of function key pressed in RPG screen.
Here is essential code...
dcl-f SF_04D workstn infds(infds1) sfile(SFL1:RRN) ;
dcl-c F1Key const(x'01');
...
0
votes
1
answer
234
views
Change the length of source PF in AS400
I created a SRCPF in an AS/400. It shows the record length as 92. I think this is the default length. I want to increase the length to 112.
After I copied a CLLE program from record length 112 SRCPF ...
0
votes
1
answer
93
views
Print 'NO RECORDS FOUND' for empty SQL table
I have a table I create via SQL on an AS400 and the SQL and table creation runs without error. The input files will always have data but after the SELECT is applied the output file could be empty/null/...
1
vote
1
answer
50
views
I'm trying to update the sequence no of the file after deleteing a record from it in SQL DB2
WITH RowNumbers AS
(
SELECT
ROW_NUMBER() OVER (ORDER BY G TLINE) AS row_num,
gtline, gttran
FROM
GPOTRSP
)
UPDATE b
SET b.gtline = a.row_num
FROM GPOTRSP b ...
1
vote
2
answers
274
views
QSYS2.HTTP_GET command, can't figure out Proxy and Headers configuration
The problem
I am trying to use SQL to do a GET request on the IBMi. The URL I am trying to query is the one that is in the documentation : 'https://www.ibm.com/support/pages/sites/default/files/inline-...
1
vote
1
answer
202
views
Create Signature in Openssl for a JWT for the AS400/iSeries/IBM i
I am struggeling to make a working signature of a certificate which will be used later in a JWT in an RPG-program.
We use this version of openssl: "OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0....
0
votes
1
answer
86
views
Getting As400 Job Percent CPU Utilization using jt400
I am trying to fetch cpu % using jt400, however I am getting cpu % as zero for all the jobs. How can I resolve this? Below is the code for reference.
JobList list = new JobList(as400);
list....
0
votes
1
answer
64
views
AS400 i5/OS - can a document allways be printed or "spooled"? CPYSPLF?
This is a strange and alien world to me, so please excuse my ignorance!
I have spent quite some time reading up on it, but I still don't really know how to even ask the right questions.
The naive ...
1
vote
0
answers
60
views
How can I detect use of a remote queue definition?
We have lots of old channels and queues that I suspect are not being used. In the case of remote queue definitions, how can I, from the MQ side, determine whether they are in use?
It seems that all ...
-1
votes
1
answer
141
views
How to display a subfile below a display file format and keep both active [closed]
I have a display file record which has an Identifier. Based on the identifier I am displaying a subfile with a few records. Now I want to accept another Identifier and show the additional records ...
0
votes
1
answer
172
views
Pointer not set error and a session crash in RPG program
I have a pointer not found error followed by a session crash during a call to a procedure but its not clear to me why. The error occurs at a rather simple assignment operation between two DS fields,
...
0
votes
1
answer
154
views
Changing the focus of the cursor to the Subfile Control Option Not Subfile Data Option, While also using RCDNBR
I am a beginner learning RPGLE and working with subfiles. I have attached an image where the red highlighted area is designed using SFLCTL, and the blue highlighted area displays data fetched from the ...
1
vote
0
answers
272
views
DB2 connection for a AS400 in powerapps
I want to connect powerapps to a AS400.
I have installed On-premises data gateway.
As far as I have studied, there is only a DB2 connector in powerapps, but I can not connect to the server, because I ...
1
vote
1
answer
171
views
RPGLE error "RNF3438 30 LIKE keyword is expected but not found; definition is ignored."
I am new to programming with RPGLE I was trying to write a simple code to read data from a file and displaying it in the screen. While doing it I get errors:
RNF3438 30 000600 LIKE keyword is ...
0
votes
1
answer
73
views
How to return a multidimensional ds in a procedure called in a different main program
Here i have defined the procedure which is returning a OrderDs of dim(256). In debug its getting the right value but when called in the main program, only the first row is printed 256 times.
Module in ...
1
vote
1
answer
77
views
On IBM Power Systems / AS400 files are not found in library list when using dynamic SQL
Scenario:
Table 1 is in library lib1
Table 2 is in library lib2
Library List is set as lib1, lib2
When I use dynamic SQL like:
sqlcmd = 'select ''1'' from table1 a join table2 b on a.id = b.id';
...
0
votes
1
answer
61
views
SQL table that will report Fld1 when criteria is met and will report Fld2 when criteria is met UNLESS Fld1 is already added to the table
All,
Imagine you have a database (File: INPUTPF) that looks as such...
Rec No
Client_Name
Class
Fld1
Fld2
1
Abbey
123
Y
2
Abbey
999
Y
3
Abbey
234
Y
4
Bill
222
N
5
Bill
333
Y
N
6
Bill
444
Y
N
7
Mike
...
0
votes
1
answer
138
views
CL Programming AS400: check fisical file members
Good morning,
with the STRSEU command I should query several physical files in a library and check if among the different fields in the various files there is the field beginning with DT. For each ...
1
vote
2
answers
92
views
JTOpen Bulk configuration
I wanted to ask something related to the Java AS400 connection driver, that is, JTOpen, and it is about whether it has a URL parameter similar to that of PostgreSQL:
jdbc:postgresql://localhost:5432/...
1
vote
1
answer
117
views
Any tool or command to export meta-data from iBM DB2 Webquery to file eg. XML?
Would like to export ALL META-DATA from existing iBM-i DB2 Webquery to file eg. .xml type of file for a client as they want to have their webquery reports meta-data migrated to other solutions. They ...
-1
votes
1
answer
214
views
pyodbc w/ iSeries Access ODBC Driver: TABLE in DATABASE not valid for operation. (-7008) (SQLExecDirectW)')
i have a problem with pyodbc, commiting an update statement in python to a as400/db2 - this is my code:
class CDP_ODBC():
def __init__(self):
self.cnxn = pyodbc.connect(
'DRIVER=...
1
vote
1
answer
98
views
JDBC ResultSet has more data than selected
I am selecting data from an AS/400 database from different tables using a change indicator. I then export the data to a file and mark the data as exported by updating this change indicator.
While this ...
0
votes
1
answer
421
views
In GENERATE_SPREADSHEET SQL on IBM i there are problems if a $ character is present in qualified names
If you have a library that begins with a $, such as $BASDTA it seems to throw off the GENERATE_SPREADSHEET scalar function when used in embedded SQL (i.e. exec sql...). At runtime it does not ...
0
votes
1
answer
183
views
AS400 SQL - Select records from a file where there are unique values based on the grouping of multiple columns
I run an SQL for a user and it work perfect! The code is pretty straight forward delete a table, create a table where we examine coulmn1 & group by coulmn1. Write out to the table any all data ...
0
votes
2
answers
223
views
SH variable in QSH on IBM i
I am trying to run a shell script in QSH of IBM i. It seems there is a problem in the system translating the variables due to the curly braces used in the script. Has anybody encountered this and know ...
1
vote
1
answer
152
views
Get a message during a submitted job
Hello everyone (first thing sorry for my english, it's not my native language),
I have a basic clle program, the purpose is to count the file total size in a library. At the end the programm should ...
0
votes
0
answers
51
views
Subfile Crud Operation Invalid Option Logic
When we enter any invalid option on the main screen the reverse image and pc is turning on for every subfile field,
//***************************************************************************
//* ...
0
votes
3
answers
183
views
System Power / AS400 - Embedded sql Cursor initial Fetch is slow
On my System Power / AS400,
i'm using embedded sql in an RPGLE Program to write a Subfile.
On a large selection the initial fetch is to slow.
When i scroll the speed is good.
Even though i only select ...
0
votes
1
answer
172
views
How to add logical operator on logical source file
I have this logical source file:
A S VALIDFLAG CMP(EQ '1')
A S ITEMPFX CMP(EQ 'PF')
But it seems that it works as an OR when I use the logical ...
0
votes
1
answer
117
views
Is there a way to simultaneously change password for numerous user account simultaneously in IBM AS/400?
I am new to IBM AS400. Recently there is a need in my company to implement a 90 days password change for all users. The problem is some users won't change their password even if we already notify them ...
-2
votes
1
answer
112
views
getting org.springframework.jdbc.UncategorizedSQLException: SQL state [HY109]; error code [-99999]; Cursor position not valid
I am getting the below exception whenever i run a method which run the following query.
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for ...
0
votes
1
answer
198
views
Provide full data on DSPJRN output file
I'm using the command DSPJRN having the parameter OUTPUT(*OUTFILE). One of the output file column is JOESD which contains the specific data for the journal. But the field length is only 100. Is there ...
0
votes
1
answer
437
views
Specified provider is not supported IBMDA400
A Microsoft SSIS (Sql Server Integration Service, as a dtsx file) was handed to me by a fellow co-worker, but when I open it in Visual Studio 2019 and try to edit one of its connections I get an error ...