views:

1751

answers:

3

Hi All,

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:

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.

+1  A: 

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.

Adrian Grigore
Good 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 :-/
Martin Carpenter
I tried your advise with the passive mode but with no avail. Any other good advice?
Grekoz
+1  A: 

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.

R Ubben
Sorry 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
That'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.
R Ubben
Hmmmmm, 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.
Grekoz
I 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.
R Ubben
I 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.
Grekoz
A: 

You should be able to specify the data set allocation parameters using the site command.

site u=SYSDA rec=VB lr=6144 blk=0 ucount=2 tr pri=3000 sec=200

That translates to:

  • unit=SYSDA
  • record format=variable block
  • logical record length=6144
  • block size=0
  • unit count=2
  • track (allocation units)
  • primary space=3000
  • secondary space=200
Robert