View previous topic :: View next topic
|
Author |
Message |
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Hi,
With FTP PUT command, if the server connection is failing before file transfer completion , at the receiver side an empty file is getting created.
How can this be avoided..
The ftp comand we are using is as follows.
Code: |
//FTPCALM EXEC PGM=FTP,PARM='69.18.217.42 (EXIT',COND=(0,NE),
// REGION=8M
//STEPLIB DD DSN=SYS1.SCEERUN,DISP=SHR
//SYSTCPD DD DSN=SYS1.TCPPARMS(TCPDATB0),DISP=SHR
//INPUT DD *
ftp_ibm
&CISIOLPW
cd CALM/IN
pwd
binary
SITE PRI=100 CYLINDERS SEC=10 CYLINDERS
PUT 'IOLDI.JAPAN.CALM.FTP' JPN.CALM.INV1.D&OYMD1.T&OHHMM
quit
|
The error is as below:
SITE PRI=100 CYLINDERS SEC=10 CYLINDERS
>>> SITE PRI=100 CYLINDERS SEC=10 CYLINDERS
nd not understood.
Command:
PUT 'IOLDI.JAPAN.CALM.FTP' JPN.CALM.INV1.D080904T1201
>>> SITE FIXrecfm 119 LRECL=119 RECFM=FB BLKSIZE=11900
nd not understood.
>>> PORT 9,56,230,201,13,215
nd okay.
>>> STOR JPN.CALM.INV1.D080904T1201
ng BINARY mode data connection for JPN.CALM.INV1.D080904T1201.
Connection to server interrupted or timed out. Waiting for data connect
*** I can't open a data-transfer connection:
open data connection.
Std Return Code = 27425, Error Code = 00009
>>> QUIT
But receiver end says the file they got with size 0kb.
Can we control this empty file creation..?Can anybody help.. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
It looks like you're having a couple of problems. Try changing
Code: |
SITE PRI=100 CYLINDERS SEC=10 CYLINDERS
PUT 'IOLDI.JAPAN.CALM.FTP' JPN.CALM.INV1.D&OYMD1.T&OHHMM |
to
Code: |
QUOTE SITE PRI=100 CYLINDERS SEC=10 CYLINDERS
SENDSITE
PUT 'IOLDI.JAPAN.CALM.FTP' JPN.CALM.INV1.D&OYMD1.T&OHHMM |
As far as I am aware, you cannot prevent FTP from creating files if they don't exist -- that's kind of the purpose of FTP, you know. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You might detect the failure and when the transfer fails, send a file delete to the remote - this might be a separate step in the jcl.
You might also consider sending the file with an "in process" file name rather than the "real" name and after the transmission is successful, rename it to the desired file name.
Either should prevent a "real" file of zero length being left on the target system.
Another thought might be to have the remote "pull" the data rather than using the mainframe to "push". The transfer would then be under control of the remote and whether to terminate or re-try could be made at the target. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
cma rajith wrote: |
receiver end says the file they got with size 0kb. |
Seems to me that this should be their problem to deal with, not yours. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If the receiver pulled the file and there were problems, i'd agree.
If my PUT fails and leaves "bad stuff" on their machine, i suspect i should handle it |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Dick, I think it'll vary by circumstances ... in the messages posted originally, the command not found errors should definitely be handled on the mainframe side. On the other hand, if the FTP signon doesn't have permissions to write to the directory, or the mount point is full, the PUT can fail and there's not much the mainframe side can do about it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Robert,
Quote: |
I think it'll vary by circumstances ... |
Yes - i agree the way you've assigned "who should handle".
I should have more clear.
If the "mainframe push" transmission gets started (no errors in control file, no connecton/permission errors on the target, etc) successfully but does not complete successfully, the mainframe process should ensure that an empty (or probably worse, a partial) file does not remain on the target.
IMHO |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
hard to tell, but it looks like a firewall problem where ftp can't establish the outgoing connection and you need a passive connection. try locsite EPSV though that must be configured and your system must be 1.5 or later. the fto command for passive connections is PASV but that requires more than just entering the command because it returns a port number that must be opened. ask your network people what is going on. They may know best |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Hi All,
Thanks for all the suggestions.I'm planning to delete the file from remote side.
Mbabu,
Cud you please eleborate on passive connection,locsite EPSV etc..Where it should be used..In the FTP step there is no locsite parameter.
How a stable server connection can beensured..What are the differnet scenarios of server connection failure? |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Hi Robert,
I have tested deletion of empty file if created at the remote server.It's successful except when the exception code of FTP code is 648,then delete step fails with file not found reason.But at the sametime the remote file is getting created there!!
Please give me some informaton on exception code of this FTP..and how can I handle this.
Thanks ,
Ceema |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I'm not sure what a 648 is ... the specifications in RFC 959, which provide the FTP reply codes, stop at 559. Could you post the exact message in context to see what it says in full? |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Hi Robert,
On a particular day FTP failed due to interruption to server connection
Std Return Code = 27425, Error Code = 00009
Then delete step got executted but that also failed saying No such file or folder Std Return Code = 13550, Error Code = 00002
But actually the remote side the file got created with 0kb size.
Following were the return codes
PROCSTEP RC EXCP
FTPCALM 2849 648
FTPDEL 1262 620
$10 FLUSH 0
$13 FLUSH 0
On other day when FTP failed with same reason(Std Return Code = 27425, Error Code = 00009),Delete step got executed fine,
Following were the return codes
PROCSTEP RC EXCP
FTPCALM 2849 654
FTPDEL 00 620
$10 FLUSH 0
$13 FLUSH 0
Both cases the error code and return code was same only difference was in exception code..
Can u see something catchy in this..
Thanks,
Ceema |
|
Back to top |
|
|
|