|
Yes, there is a simple way to do it which we are using all the time. Use the UNIX Api's to write your data directly to the IFS file system. For example, /home/AS400_IFS_Folder/myfile.txt Then you can use NETSERVER to allow your users to directly access these files. If you have V4R2 or above, you can, also, use the QNTC file system to write directly to a NT drive on a NT server. For example, /QNTC/NT_Folder/myfile.txt The user can then just directly access the file on a NT server. One warning, writing to the QNTC system is pretty slow. You might get a lot better performance writing to the IFS and letting the user pull from NETSERVER. In either case, you must have NETSERVER setup on your system. This capability provides us with the ability to seamlessly write data from an ILE RPG program and, also, read text data directly from a IFS or NT drive. The only catch here is that you must configure NETSERVER and write to the UNIX API's which takes some work. As an alternative, I have written a service program and, I believe many other people, that hides all the complexity of the Unix API's. For example, c eval ehResult = OpenIFSFile(cFilePath: c (O_CREAT + c O_CODEPAGE + c O_RDWR): c FileHandle1: c (S_IRWXU + c S_IROTH): c cCodePage) c eval ehResult = WriteIFsFile(FileHandle1: c Yes: c %editc(Counter:'X') + cRecord2) c eval ehResult = CloseIFSFile(FileHandle1) c eval ehResult = ReadIFSFile(FileHandle1: c RtnEOF: c RtnString: c RtnStringLen) I would be glad to share the code for this service program with some examples of how to use them. If you are interested, please send me an e-mail directly. I definitely would not recommend trying to build your own functions in less you have some time to burn and experience with "C" type functions. The Unix API's are not extremely complex but building the functions is not trivial. I ended up spending two weeks building and debugging them. Others who had more "C" experience may have done it quicker. That investment in time has been paid back many times over. At the time I wrote them, I only had an example from Midrange that had the code for doing the writes embedded in a program. Today we have a lot more functions available. When I can, I try to reuse the code other have already built as much as possible. Just wish we had a web site and a set of protocals in place like the Open Source community to build a library of standard functions. Different people submit code and a working group goes through and arrives at a single set of code and objects that is published so they can be debug and enhanced in one place. I know there are multiple sites setup to provide RPG code but each represents different version of functions and there is no set of common functions like the "C" function libraries. Anyway, my two cents. Thanks Alan Campin alan.campin@caselogic.com -----Original Message----- From: Rae, Chris [mailto:ChrisRae@hwrm.com] Sent: Tuesday, January 04, 2000 10:12 AM To: 'RPG400 News Group' Subject: Transfer of File from PC to AS400 Please, could anybody tell me if it is possible to transfer data from a PC file from within an RPG ILE. The intention is for it to be seamless for user (ie, not using the Transfer from PC function of Client Access), and preferably straight from a network drive, not an AS400 folder. Bearing in mind the "RTM" epithet, suggestions of where to look would be greatly appreciated, not necessarily hand holding. Thanks in advance Chris +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.