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 Usergroups Profile Log in to check your private messages Log in
 

 

Issue FTP PUT statement without replacing existing file

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

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Fri Jun 22, 2012 11:56 am    Post subject: Issue FTP PUT statement without replacing existing file
Reply with quote

Hi,
Is there any way we can issue an FTP PUT command so that this command fails when the file is already present on the server and not replaces it?

I can't do a DIR/GET for the file because the server seems to be meant only for PUTs, and fails evertime when we issue a DIR/GET with a 451 File not found error even though there's no file on server, which is wierdly sad.

The only way out is to use a variant of PUT so that it ensures it fails if the file's already there and places the file if there's no file..

Note. The file has a particular naming convention, and I can't use DATE or Timestamp to workaround icon_sad.gif
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Jun 22, 2012 12:39 pm    Post subject:
Reply with quote

Hello,
Quote:
Is there any way we can issue an FTP PUT command so that this command fails when the file is already present on the server and not replaces it?

'FTP PUT' will replace the destination file blindly. I think this cannot be changed.

FTP GET has a REPLACE option but im afraid it won't be of any use to you in this scenario.
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Fri Jun 22, 2012 3:08 pm    Post subject: Reply to: Issue FTP PUT statement without replacing existing
Reply with quote

Hi Vishwamurthy,

Manually login to the server and rename the existing file. Then run your FTP job.

Thanks
-3nadh
Back to top
View user's profile Send private message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Fri Jun 22, 2012 3:14 pm    Post subject:
Reply with quote

i think what you mentioned should help, although there's a requirement which says if the older file is present, it means that the previous instance of the process din' run. So if that will run, it should pick the renamed file and not the current file, which i'm afraid cannot happen..
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Jun 22, 2012 5:18 pm    Post subject:
Reply with quote

RFC 959 indicates the STOR command, which is the official name for the PUT command, replaces an existing file. Unless your implementation of FTP is not standard, there is no way to change this behavior -- if the file does not exist, it is created; if the file does exist, it is replaced.
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: Fri Jun 22, 2012 6:51 pm    Post subject:
Reply with quote

Hello,

Suggest you work with the network and/or server sujpport people and find out Why you cannot issue the DIR command. . .
Back to top
View user's profile Send private message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Tue Jun 26, 2012 1:33 pm    Post subject:
Reply with quote

We're thinking of this:
File01 for the first run
File02 for the second and so on..
This should help them pick the right file for the right process based on the number at the end..

Thanks guys, this can be closed now..
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 Jun 26, 2012 10:08 pm    Post subject:
Reply with quote

Hello,

If someone has to "pick", sometmes they will pick incorrectly. . .

Why is the missing run not an issue?

Someone still needs to determine why the DIR cannot be done.

The issue can be "closed" (i.e. if no one else replies, it is closed icon_smile.gif ), but there are still issues that need to be resolved.

If this approach (getting around problems rather than addressing them) has been used every time something is amiss, the entire environment is probably a 'time bomb" that may completely destroy itself.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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