I am using a .TXT file in QCLSRC for FTP input. Instead of having the 4 records sitting there all the time. I want to be able to write to the .TXT file when a program is called.
I am using a .TXT file in QCLSRC for FTP input.
Usually ".TXT" is contradictory to "QCLSRC". A ".TXT" file would be a streamfile in the /root file system while "QCLSRC" would be a physical source file (i.e., a database file) in the /QSYS.LIB file system.
You might have a ".TXT" streamfile that is copied into a QCLSRC source member, and the resulting source member is then used as the input script for FTP. Or you might simply be using terms that aren't appropriate because you aren't familiar with what is happening.
ILE RPG can read/write .TXT streamfiles, and it can also read/write physical source file members -- but the two methods are very different. Streamfiles are handled with the common Unix APIs for open(), read(), write(), close(), etc., while physical files are accessed with RPG instruction codes for database I/O.
Can you clarify what you need to do? Do you know if you really have a ".TXT" file?
Tom
I created a source physical file named FTPSRC for my FTP input.
I add or clear the relevant member, write the FTP script to the member, then override to that member when running the FTP.
In your RPG program, use an output file - you might want to call it "SOURCE". In the RPG program you can write to the file from, for instance, a table.
Outside the program, override the file "SOURCE" to the actual physical file member and compile the program interactively instead of compiling in batch. When calling the program, call a CL program that does the file override and calls the RPG program.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 3  Replies