|
Jim, Keep in mind that the files in the root file system (which is what most people think of when you say IFS) are stream files. They have no concept of a record (granted, you can make your own up, but why not use a database for that type of information in the first place). All they are is a collection of bits. The prototypes for basic operations only take up about a dozen lines and another 30 lines or so for constants for the open() API. You could easily put them in a separate file to copy in so you only do this once and likely will never have to touch them again. The open() API does take several lines to populate the fields for the various flags and the file name but how's that worse than defining a key list and populating it? Writing to a stream file takes one line plus whatever you put in for error handling (which you need to do with the native database methods anyway) and a close is one line plus error handling. So it is it more lines of code? In most cases yes, but not that much more and the bulk of it can be in a separate file that you include in the source. If you really need to do the type of access to a stream file that setll type operations imply, wouldn't it be better in most cases to just put it in the database? Matt -----Original Message----- From: Jim Langston [mailto:jlangston@celsinc.com] Sent: Thursday, July 11, 2002 4:13 PM To: 'rpg400-l@midrange.com' Subject: RE: IFS in RPG To be fair, Hans, I can code in Native RPG IV a *lot* faster than coding to an API in RPG. If I want to read a records from a DB2 file I code an F spec, a setll, a read(e), and a not eof() If I want to read from an IFS file I have to write a Prototype for the file open, prototype for the file read, prototype for the file eof, prototype for the file close, then I can actually write my program. True, I can design these once and put them in a library and link to that, but now I have more maintenance issues, etc... So, 4 lines of file I/O code native .vs., what, 25-30 lines of code to write to APIs? Understand, I'm not saying that Rochester should drop everything and write native RPG IFS file I/O <g>, I'm just saying there is a point for native RPG file I/O Regards, Jim Langston Programmer/Analyst NT Administrator Cels Enterprises, Inc. (310) 838-2103 x604
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.