Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 5, Number 18 -- May 4, 2005

Use Special Files to Access the IFS


Hey, Ted:


The code for this article is available for download.


I was looking for a way to simplify writing data to IFS files, and your article about special files inspired me! I wrote program PTIFSIO, which is to be used as a special file program. This program enables any RPG program to read from and write to the IFS without APIs. I have also attached a program which writes to an IFS file and one which reads from the IFS file. The examples are perhaps trivial, but they show how to use the special file support.

I am grateful to Scott Klement for the IFS prototypes and constants I used in PTIFSIO. I pulled much of that code from his "Working with the IFS in RPG IV" e-book at www.scottklement.com/rpg/ifs.html.

--Kevin Juenemann, Infinitec


Thanks to Kevin for sharing his code with the rest of us.

PTIFSIO provides a wrapper over four Unix-like APIs: open, close, read, and write. I've used those APIs in RPG programs, and it's too easy to make a mistake with them.

I've placed source code for four objects in the downloadable code. You'll find the three programs Kevin mentioned and the DDS for a physical file named TAXMAS. If you play with the examples, run the program that writes to the IFS first, since it builds the file that the other test program reads from. When you load the TAXMAS file with data, make sure that some of the records have zip code values of zero.

Speaking of special files, Nathan Andelin recently posted in the IT Jungle Forums that he has used a special file to make an RPG program work with a Web browser. (You can see that post in the forums by clicking here.) I hope to hear from more readers who have developed other uses for special files.

--Ted


RELATED STORY

"Special Files Can Do It All"


Sponsored By
ITERA

What would it cost your company if your
iSeries was down for 2½ days?

One large iSeries shop recently experienced a crippling system failure followed by a series of complications that kept the system down for 2½ days!

Fortunately they had just installed iTera's Echo2 High Availability.

The result: no data was lost, little downtime occurred and users barely had a clue.

Click here to read the full story.


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

iTera
WorksRight Software
Patrick Townsend & Associates


Four Hundred Guru

BACK ISSUES

TABLE OF
CONTENTS
Use Special Files to Access the IFS

Take Two: Where Did I Come From?

Admin Alert: Configuring i5/OS and a Windows Network Server for SSO


The Four Hundred
The i5 Tests Well on SAP Data Warehousing Benchmarks

A Bunch of IBM iSeries Announcements

Tools Can Help Manage Change and Diverse Systems

Deloitte Says Outsourcing Doesn't Always Pay

Four Hundred Stuff
Exercises in Simplicity

Lakeview Adds Quick Start Service to Disaster Recovery for SMBs

ASC's SEQUEL Database Tool Goes Multi-Platform

Kisco Launches Spool File Distribution Software

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement