× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Is anyone familiar with a "green screen" method to enumerate file names in a
directory on the IFS?  A WRKLNK > directory_files.txt if you will?

The easiest way is with QShell...

STRQSH CMD('ls > /home/buzz/directory_files.txt')

I have a situation where I'll be getting multiple files from an FTP site
(using Scott Klement's cool procs), then bringing the data up to a DB2 file
via CPYFRMSTMF's (appending the data as I go).

FTPAPI has the ability to receive directly to a PF. You can also use FTP_getraw() to have the received data come straight into your program where you could use RPG op-codes to write it to a PF.


If you'd like more info (and can't figure it out from the TESTxxxx members in FTPAPI) please ask on the FTPAPI mailing list:
http://www.scottklement.com/ftpapi/ftpapilist.html


So, I'm looking for a mechanism to identify the names of the stream files to use with the copy command. I did a quick scan of the API's and nothing jumped out at me. Anyone done this sort of thing?

When you receive the files via FTPAPI, you'll know the filenames, won't you? Why not just do the work there and then?


If you do want to use APIs, the opendir(), readdir(), closedir() APIs will give you a list of files in a directory of the IFS. There are examples of this on my Web site, and also probably in the archives of this mailing list and/or RPG400-L.

My IFS tutorial has examples of the APIs, and can be found at the following link:
http://www.scottklement.com/rpg/ifs.html


I'm also doing a (free) Webcast on IFS programming with ILE RPG on March 22nd. Info about that can be found at the following link:
http://www.iseriesnetwork.com/content/f3/index.cfm?fuseaction=webcast.viewwebcasthome


And, of course, you can also use QShell as shown above. Again, search the archives and you'll find some more in-depth examples of the QShell method.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.