as400

How do I register IBM.Data.DB2.iSeries as a linked server provider in SQLServer?

I have connected to a DB2 database on our AS400 through SQL Server 2005 (linked server) using the IBMDA400 (OLEDB) provider. However, I recently discovered that I can connect my .Net apps using the IBM.Data.DB2.iSeries.dll provider so I would like to connect to the AS400 using my IBM.Data.DB2.iSeries provider instead. However, the IBM.Da...

Calling a remote Java program on iSeries from RPG

I'm looking to invoke a Java program from RPG running on Iseries V5r4. The remote program is a web service client (performing a postcode lookup), running in Websphere. Ideally I'd like to call it direct from RPG? is that possible? or do I have to create a java program to run on the iSeries and use RMI or something to call the remote j...

Conditional Compilation in RPG(LE)

Can I include a section of code based on whether a variable is defined in my program, or is the preprocessor completely unable to access this information, only compilation conditions? I.e. I'm after something like: /IF DEFINED(myVariable) D myOtherVariable S like(myVariable) /ELSE D myOtherVariable S ...

[SQL0302] Conversion error on host variable or parameter *N

I am getting this Error on Insert statement to AS400 database, using Java with JDBC. ...

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 mess up and there are memory leaks then when will this memory be reclaimed? Is it when ...

How can I perform an SqlBulkCopy (equivalent) using an ODBC connection in C#?

Hi all, I am working on a project where I need to extract data from a MSSQL database table, and then insert the data into a table of the same structure on an AS400. The SqlBulkCopy would be the ideal candidate for this operation, but fails (understandably) because the AS400 uses an ODBC connection. Any help or suggestions on this woul...

External stored procedure on IBM i

I am trying to create an external stored procedure on an IBM i (V5R4), but I'm getting an error when I try to run it. All I want to do is call an RPG program, without passing any parameters or worrying about returning any data. Sorry, I'm not an RPG programmer or an expert on IBM i, so I could be missing something very simple. The SQL ...

Add a column to a DB2/400 table with a specific ordinal position

Is there an SQL command on the AS400/iSeries/System-i/whatever to add a column to a table in a specific ordinal position, or moving an existing column to a different position? ...

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 different value for all common inputs. I don't care particularly what the integers are. In a C li...

ASP.NET to AS/400 Communication Error

When trying to access an AS/400 server from an ASP.NET webservice, I'm getting the following log message: 0x00000D98 0x00000001 10/14/2009 16:16:08.734375 : iDB2ConnectionFailedException(9119245).Void .ctor(System.String) : iDB2ConnectionFailedException thrown 0x00000D98 0x00000001 10/14/2009 16:16:08.750000 : iDB2Error...

Unpacking AS400 packed decimal (BCD) - possibly borked by EBCDIC conversion?

I'm getting files transferred from an AS/400 to our Windows (SBS 2003) via FTP. The files are fixed-width data. The text appears fine, but some of the fields are packed decimals, which when unpacked give bad values. My assumption is that there's an implicit EBCDIC->ASCII conversion happening, which is converting the packed bytes too. ...

Is there an numeric type in ILE RPG which will overflow without crashing my program?

I'm looking for a numeric type in ILE RPG which will "wrap round" when it overflows, in a similar way to how a C int would. Is there such a thing? ...

Access AS400/DB2 with SQL 2008 Express

I'm trying to add the AS400 as a linked server in SQL 2008 Express in order to access some tables in a DB on the iSeries. I've tried all of the OLE providers with many different strings and have had no luck establishing a connection. Is this even possible with this version of SQL? Thanks ...

AS400 DB2 Journals search

I am new to DB2 administration on AS400, could you point me to the best practices/tools to search for errors in the DB2 journals? So far I use the DSPJRN command but I am unable to make research. thanks. ...

Reporting with DB2

I started learning .net about 3 years ago. I have gone thru a boot camp during that time learning OO and various data access technologies such as NHibernate, Subsonic, LINQ TO SQL. didn't wanna try EF cause it hasn't reached version 3 :) As far as reporting goes, I have heard that many ORM'S fall flat on their face when it comes to rep...

SQL Update from a Select

Hey! I want to update two fields of table (Store) from a select of others tables, but i don´t know how i can do it. The SQL system is in AS/400, so doesn´t have SQL Server or Oracle tricks :( Here is the SELECT, i want the price and amount of an order (article table join for select only existing articles) SELECT OrderDetails.Price, Ord...

Is CPYTOIMPF to qtemp faster than to other library?

I am a programmer working on IBM AS400 V5R4. I create 2 CL programs, both of which use CPYTOIMPF to format a list of AS400 PFs to character delimited files. The difference between them is: one formats files to qtemp(PGM A), while the other one formats files to a library other than qtemp(PGM B). I called the 2 program separately to forma...

Best way to access data stored in relational files (not DB2) on an AS400, using .NET?

We have need to connect to an AS/400 from .NET (C#) and access (read and write) data. The issue is the data is stored in relational files on the mainframe, not in a DB2 database. What is the best way to accomplish this? I would love to use an ADO.NET Entity Framework type solution, but I believe the compatible data providers only work ...

Oracle: Set Query Timeout

Hello, i have a PL/SQL program which do a query to an AS400 database through Transparent Gateway. Sometimes the AS400 not responds to the query (may be network problems )and the PL/SQL program hangs. Is there any method to set a timeout to the Oracle query so that when certain amount of time passes an exception is risen? ...

FtpWebRequest Connecting to an AS/400

I need to download some files via ftp from an old AS/400 server. My code looks more or less like: FtpWebRequest _request = (FtpWebRequest)WebRequest.Create("ftp://ftpaddress/FOO.CSV"); _request.Credentials = new NetworkCredential(_ftpUsername, _ftpPassword); _request.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse response ...