Uploading to mainframe using FTP
Solution 1
I sometimes get this error because of firewall problems when trying to ftp behind a router. You might try switching to active or passive mode (depending of what you are currently using) to see if this helps.
Solution 2
I have a couple of programs that do this, but without specifying record size. The blocking command should be okay. Are you sure you don't have a permissions issue? Does ADM.SAMPLE.TEST already exist, and is it 500 bytes at least? If not, have them create it for you and see if the ftp works then.
Related videos on Youtube
Grekoz
Updated on June 04, 2022Comments
-
Grekoz almost 2 years
I just want to know how you upload datasets specifying its characeteristics? E.G. using the command quote site lrecl=500 recfm=fb
Well, the command was accepted when I tried to use it, but the problem is that when I tried to upload the file using the command 'send' ftp hangs up, and definitley closes the session.
This is the sample:http://www.mvsforums.com/helpboards/recent.php?sid=dab6b1f3cda149c7d7db855d90acaab1
ftp> quote site lrecl=500 recfm=fb 200 SITE command was accepted ftp> send C:\test\test.txt 'ADM.SAMPLE.TEST' 200 Port request OK. 425 Can't open data connection. ftp>
Any help will be appreciated. Thanks.
-
Martin Carpenter almost 15 yearsGood advice. Grekoz is running active (see "Port" command), and passive mode generally plays better with firewalls. Unfortunately the standard windows client (XP at least) doesn't support passive mode :-/
-
Grekoz almost 15 yearsSorry for this late reply, I manually pre allocated an empty dataset with the same attributes as to what I will upload and I was suprised that if there is an existing dataset with the same attributes when you upload, I mean when you upload and overwrite the existing dataset with the same attributes, the upload is successful. But if I upload with out pre allocating an empty dataset with the same attributes the upload fails.
-
Grekoz almost 15 yearsI tried your advise with the passive mode but with no avail. Any other good advice?
-
R Ubben almost 15 yearsThat's been my experience. If you write to a file, the file has to be there already. So, for my uploads, the mainframe programmers have batch jobs to fill the files with zeroes at a particular time. I ftp to them, and then they have another job that comes back to either use the contents or complain if there are still only zeroes.
-
Grekoz almost 15 yearsHmmmmm, its seems that we have the same problem. Isn't there any way to send a dataset using ftp even if the dataset was not pre allocated in the mainframe? But if there isn't any workaround aside from yours then I guess I have to pre allocate the dataset before uploading. Thanks anyways, I appreciate your advice.
-
R Ubben almost 15 yearsI suspect the behavior is intentional, maybe resulting from design choices to keep the filesystem as fast as possible. Disk space allocation seems to be a big part of life for mainframe programmers.
-
Grekoz almost 15 yearsI will try uploading the files to mainframe via Terminal Emulator, using IBMs Dll EHLLAPI.dll. I have tried uploading using my terminal emulator with different attributes and was successfully uploaded. I'll tell you if it works.