IBM System i

IBM i, formerly known as AS/400, is a proprietary, midrange, object-based operating and application system. It includes a relational database, a menu-driven interface, support for multiple users, block-oriented terminal support and printers, and supports security, communications, and web-based application servers including Websphere, Apache and Tomcat.

Share tech news, updates, or what's on your mind.

Sign up to Post

How do you copy the records in a member file into a physical file?  I need to export the records in to the member data to an excel file for further manipulation...
Is there a way to see all jobs included under the STATFS command? Besides the Root directory?
AS/400, iseries, System/i help please.  I renamed a library or something and now I cannot log in, with any user id.  It flashes a job log, then gives the sign on back.    I was doing some testing and renamed some test libs and what I did should not have affected me regular user id's.   Any way to bring it up in STRSST mode or something, so I can see the logs and make changes?  I have tried QSECOFR and all the user id's that I know.
Good Morning,

I'm using SPLF2EMAIL (which converts to a PDF and uses SNDDST) to send documents to our users. This work well, but the subject line get changed to the 'document.txt' id instead of the message (verbiage description) sent.  The '*.TXT' is the DOC() value used by SNDDST command. The verbiage I send gets put in the msg() field on the SNDDST command and is the first line in email.  Is there a way to change this to send a more useful subject line instead of the document ID. (preferably the verbiage currently be sent in MSG()).

Thank You in advance.

Sorry, I should have edited this question and not deleted. It is sending the verbiage after the '*.txt' on the description line in gmail when I view via the inbox. However, on my phone it only shows the *.txt.  I was deleting because it is not as clear a question. But decided to re-post because I'm still not sure how to get the verbiage to be the main subject line, or if I can.

Again... Thanks
Problem is : iSeries interactive sessions disconnect unexpected.

With Joblog error-msg CPF2479    "Call stack entry not found",
before disconnect session with CPF5140.

My question is: may be a dependency,  CPF5140 caused by CPF2479 ?
I am asking this, because disconnection may also  be caused  by a betwork failure.
(But nearly in all disconnected Jobs, there are many CPF2479 before . . . )
iSeries menu question - Can I disable the functions keys? I don't want F3/F12 to exit the menu. I want an option selection to be the only way.

Thanks in advance!
Hi Experts!

I am running into an error when using CPYFRMIMPF and numerics.    When I run the CPYFRMIMPF command I get these errors..  The copy did not complete for reason code 9. When I have the DDS fields all alpha numeric it works.

This is my CPYFRMIMPF code:

0049.00              CPYFRMIMPF FROMSTMF('/ZIP/ZIPFILE.CSV') +              
0050.00                           TOFILE(*CURLIB/&EDTF) MBROPT(*REPLACE) +  
0051.00                           RCDDLM(*LF) STRDLM(*NONE) +              
0052.00                           RMVBLANK(*TRAILING) RPLNULLVAL(*FLDDFT) +
0052.01                           RMVCOLNAM(*YES)                          
This is a sample of the data from the ZIPFILE.CSV


This is my DDS:

0001.00 0008 A          R ZIPCREC                   TEXT('ZIP RADIUS')
0002.00 0000 A            ZIP              5A         COLHDG('ZIP CODE')
0003.00 0000 A            ZDIST          4P 3     COLHDG('DISTANCE')
0004.00 0000 A            ZCITY        30A         COLHDG('CITY')    
0005.00 0000 A            ZSTATE       4A         COLHDG('STATE')  

Thanks for your help!!
How to get IFS details (directory inventory, tree . . .) from QUSRBRM file QA1ALI2
without BRMS Report functioin, directly from QA1ALI2 (convert ASCII?) ?

Found solution :
Directory pathes are stored in BRMS in file QA1A1DI2,
field DINAME (to convert with function varchar by query ...).
We are getting the following error, "Resource limit type 14 exceeded with reason code 542".  When looking at type 14, it says, "If this is error type 14, reduce the number of allocated descriptors with the DEALLOCATE DESCRIPTOR statement."

I was wondering if anyone know how we could monitor our program for how many descriptors are currently being used?

I found we could use the following statement to allocate descriptors, "EXEC SQL ALLOCATE DESCRIPTOR 'NEWDA' WITH MAX 20" - but if we don't know how many we currently have - seems like this isn't going to do much for us.

Any ideas?
Hi experts,

I have some pointer questions for some time, but now I finally want to know. :-)

Why Can't I use :
    callp MyProgram(%addr(Var1:%addr(Var2))
This give a compile error.

Why Can't I use a pointer in my pi parameter directly?
a Data-structure based on a incoming parameter pointer will show only '*****' values.
(now I have to base it an an other pointer, and fill that one with the parameter value).

I did read the Scott version of "messing around with pointers", but I cant find the answer there :-)
Is it possible to retrieve a listing from audit journals  on the IBM i, of all user's that answer a 'spool' file message?
I am trying to connect to MS SQL Server 2016 from an IBM-i (V7R3) to populate a table used as a data source for a drop down selector (LaserFiche Forms)
I am currently running a C# program on a 3rd box, calling an IBM-i program to create the data on the IBM-i, then create a collection in C# from that data, and finally running a set of SQL statements on the MS SQL Server to re-populate the data there.
I'd really like to eliminate this middle tier and go straight from the IBM-i to SQL Server.
I've tried Scott Klement's JDBCR4 but I can' t get it to connect to the SQL Server. I'm using the MS JDBC driver - sqljdbc42.jar file. I've tried using my domain login and also tried to create an ID in the SQL instance but neither of those worked.
Any help/examples would be appreciated.
I was sending XML in SOAP envelope to a web consuming server here at Lone Star. The Web consuming service has now switched from XML to JSON. Does the SOAP envelope change? If so in what way? I'm attaching the actual output to the Web Service. Using Krengeltech's RPG-XML to generate the XML data formatted and wrapping it in the SOAP envelope. Krengeltech also has a JSON api to perform the data mapping in JSON instead of XML. I need help creating the 'wrapped' soap statements
On IBM i, Is there any way to find the name of an IBM i object from a pointer (ex...80000000000000000000040190010000)?
Sterling Connect Direct on i5 :
Version 3.5 should be ugraded to Version 3.8.
Has sombody  experience with parallel installation of 3.8, because there is no upgrade plan provided by IBM  (3.5 is too old).
I'm trying to install cURL on our IBM I v.7.2 and have downloaded the AIX binary to the IFS root directory using Navigator.  I have run the command CALL QP2TERM which opens the PASE command line, CD to directory :  Mycurl\opt\freeware\bin\   which has listed curl , curl_32 and curl_64.  when I run  'curl' from the command line I get this error:
 > curl                                                                                  
   exec(): 0509-036 Cannot load program curl_64 because of the following errors:        
           0509-150   Dependent module libcurl.a( could not be loaded.      
           0509-022 Cannot load module libcurl.a(                          
           0509-026 System error: A file or directory in the path name does not exist.  

I can not find any simple steps on installing cURL on the IBM I.  Please help, thanks!       I downloaded cURL from:   AIX
Convert 8 digit numerical field date in CCYYMMDD format to MMDDCCYY format in free form rpg.

This little trick doesn't seem to work in free format.
*DATE         MULT      10000.0001    XXDATE            8 0

how can i convert 20180501 to 05012018 on one line of code?
RPG code to extract first and last name from an "entire name" field.

I have a field that has clients' entire name.   Last name is always first, followed by a space.  I need to get all the characters until a space is found and put those chars into a last name field. Then, grab all the chars after the space and put those in the first name.



SMITH                                TED B.
SMITH                                RANDY
SMITH                                TOMMY R JR
JONES                                 BRETT
Hi Experts,

I have some SQLRPGLE problems with reading a tabel (with null capable fields)
The program reads a record in a DS , change 2 fields and write it to a remote (identical) table.

But I have to add a null "check field" per field
exec sql fetch next from cIMPH INTO
 :DS_REFERENCE       :ISNUL1,          
 :DS_CONTEXT         :ISNUL2,          

In this example it's not a problem, but I need to do this for a file with round 100 fields.
So I prefer to use the SQL

exec sql fetch next from cIMPH INTO :DS;

On top of that, if I use the null-check field, the original field contains a space or a zero.
the remote table expect null values.

How can I solve this?
Hi Experts,

After creating several tables with SQL (because of the naming I have to use), I have in my Data Library files with names as CUST_00001 and PROD_00001 (as expected),
The field names in the files from DB2 site, are numbered CDTA_00001, CDTA_00002 etc.  (also as expected),

I prefer to have the SQL field names in my SQLRPGLE program, so that I can create a readable (maintainable) program, is there a way to manage that?

We have very large Journal receiver (about 61 Gig) on the system journal QAUDJRN. We will be swapping the receiver and changing it to be managed by the system, but I am wondering how long the CHGJRN command will take with a receiver that is so large.
Does anybody have any experience of changing journal receivers? and know how much time the process usually takes?
I am wondering if there is a way to view all the jobs that have ran from a particular JOBQ for the past 24 hours (or the past xx hours)?
I have an application AS400/iSeries application that i am using to scan receipts into the warehouse.
The scanner is a Zebra TC20 scanner. (droid based)  I am using the Mochasoft emulation.  Pretty vanilla.

When I scan into a field, I would like the program to advance to the next field to be ready to scan.   I am using the DDS keyword Check(ER) on the fields.  but that doesn't seem to make a difference.  If I scan data that is the exact same size as the field, then it does advance.  But the part# is like 10 long, but I am only scanning 5 characters.  It needs to jump down to the qty, but doesn't.  It will if you press tab on the device.
Any way to make it do this?  this is my program.
Qty Recvd:                  

Any ideas?
Hi Experts,

In a CL I collect information about *.CSV files in a specific IFS map.  /mypath/*.[Cc][Ss][Vv]
The output is redirected to an existing file /QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR

On our developementserver it worked fine.

Now we transfered the software to the testenvironment on the production server
And it still works as expected.

Once we tried it on the Production environment, it stop working, (the  /PRODLIB is located on ASP1).
so I added  /IASP1 to the path,
and still get the error:
qsh: 001-0055 Error found creating file /IASP1/QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR. No such path or directory.
Hi Expert(s),

Is there a way to write Data (eventually with SQL)  from the AS400-DB2 to a MySQL-DB or Oracle?

IBM System i

IBM i, formerly known as AS/400, is a proprietary, midrange, object-based operating and application system. It includes a relational database, a menu-driven interface, support for multiple users, block-oriented terminal support and printers, and supports security, communications, and web-based application servers including Websphere, Apache and Tomcat.

Top Experts In
IBM System i