Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Empty file creation on receiver end for FTP PUT command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Tue Sep 09, 2008 7:26 pm    Post subject: Empty file creation on receiver end for FTP PUT command
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 09, 2008 7:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 09, 2008 10:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed Sep 10, 2008 12:55 am    Post subject: Re: Empty file creation on receiver end for FTP PUT command
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 10, 2008 2:40 am    Post subject:
Reply with quote

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 icon_question.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Wed Sep 10, 2008 3:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 10, 2008 5:47 am    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Wed Sep 10, 2008 1:23 pm    Post subject: Reply to: Empty file creation on receiver end for FTP PUT co
Reply with quote

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
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu Sep 11, 2008 4:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Mon Sep 15, 2008 10:36 am    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Mon Sep 15, 2008 5:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Tue Sep 16, 2008 2:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Failure after DIR command Hank Watson All Other Mainframe Topics 2 Tue Aug 29, 2017 3:14 am

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us