We need to pickup a file from a vendor via FTP. The vendor has the FTP file created as one record, 90,000+ bytes long, even though it should be segmented into 80 btye records. When we do a staight GET, it wraps the file into a length of 32,767, and errors out after three records have been written. If we issue the BIN command, we get the whole file as one record. How do I translate this file from binary into EBCDIC once we've received the file? TIA, John.
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
FTP
Collapse
X
-
FTP
Hi John, Actually, your bigger problem is that you effectively have a one record file longer than allowed in the Library File System or RPG. My solution would be a small java program that A) reads in the file as 80 byte chunks and writes out an 80 byte record file or B) reads in the file and writes out translated records or C) reads, translates and writes to a physical file in QSYS.LIB system. For A) If you're on V4R4, you can use CPYFRMSTRMF and specify conversion. If not, probably go to C. Same for B) C) handles everything. If for some reason you decided to write to a physical file without translation, QDCXLATE on the resulting physical file is another route. All of this can be done and automated on the 400 without involving PC transfers. Best, Joe Sam Joe Sam Shirah Autumn Software Consulting/Development/Outsourcing Please Note New Email: jshirah@attglobal.net Visit our User Group at: http://www.jax400.com
Comment
-
FTP
Hi John, I understand very well, but you run into the approximately 32k record length limitation. The hammers you have aren't going to hit that nail as it sits. Offhand, the solutions to me are: Get someone from outside to write the program for you. If it went beyond three days, I'd be surprised, and at that I'm including a lot of testing and set up time. Get the vendor to send the data in a form you can use. I assume this isn't viable or you would have done it first, probably. See if you can somehow get the data broken into less than 32k portions. Good luck. Joe Sam
Comment
Comment