View Full Version : FTP
01-01-1995, 02:00 AM
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.
03-16-2000, 05:28 AM
Try FTP'ing the file to a PC in binary. Once you have the file, transfer the file to the AS/400 using client access or cpyfrmstmf. This will convert it from ASCII as it sends it to the 400. ==Scott==
03-16-2000, 05:46 AM
Thanks for the response. I'll have the programmer working on this try your suggestion. However, we would like to automate the process to run daily from the AS/400. John
03-16-2000, 12:07 PM
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: firstname.lastname@example.org Visit our User Group at: http://www.jax400.com
03-17-2000, 05:04 AM
Thanks for the suggestions Joe. The AS/400's are at release level 4.3 and none of the programmers here have yet to learn Java. (including me) I was hoping for a RPG/LE or CL solution. John
03-17-2000, 09:22 AM
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
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.