Accessing the IFS from RPG

Article ID: 16349

Q: Can I access the IFS from RPG or CL? If so, is there any sample code available?

A: There are several examples available on the iSeries Network and from other sources. Here they are, grouped by function:

a. General routines:

RPG IV programs by Thomas Raddatz
http://www.tools400.de/Downloads/Freeware/Code/cfunc.zip

RPG IV programs in the Open Source iSeries-toolkit Project
http://www.iseries-toolkit.org

b. Reading an IFS directory:

RPG IV program by Carsten Flensburg
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=10219

RPG IV program by Gary Guthrie
(You must be an iSeries Network Professional Member to read this article.)
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=10372

Utility DspIFSObj by Jeff Yanoviak
(You must be an iSeries Network Professional Member to read this article.)
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=14800
The V4R5 save file is available at
http://www.iseriesnetwork.com/code/index.cfm?fuseaction=DownloadFile&type=save&yyyy=2002&file=f2002_08V4R5.zip.

RPG IV program DIR by Peter Connell
http://www.ediconsulting.com/dir.zip

c. Reading/Writing an IFS file:

RPG IV programs by Carsten Flensburg
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=10214

RPG IV programs in the IBM Redbook "Who Knew You Could Do That with RPG IV?
A Sorcerer's Guide to System Access and More" (SG24-5402)
http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245402.html
Sample code for the Redbook:
ftp://www.redbooks.ibm.com/redbooks/SG245402/

d. Retrieving IFS file record counts or size:

CL utilities STMFRCDNBR and RTVIFSSIZE Herman Van der Staey
http://www.iseriesnetwork.com/Forums/Thread.cfm?CFApp=55&Thread_ID=29773&mc=6 .

e. Testing for the existence of an IFS object:

Several RPG and CL sample programs were listed in this December 2002 Club Tech Tip:
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=15823

f. Converting timestamps returned by IFS APIs:

RPG IV program by Gary Guthrie
http://www.iseriesnetwork.com/features/newmf/Article.cfm?ArticleID=11633

ProVIP Sponsors

ProVIP Sponsors