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
 

 

Can we rename a file using SFTP

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Feb 23, 2010 8:50 pm    Post subject: Can we rename a file using SFTP
Reply with quote

Dear Experts,

I use the SFTP to transfer the files from Mainframe to UNIX applicaiton.

My rquirement is to rename an existing file on OMVS with a new name on daily basis.

Is it possible ?
If so, please give me the sample code.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Tue Feb 23, 2010 9:10 pm    Post subject:
Reply with quote

Is the file to be renamed on the remote server or the local machine? That will make a difference, as well.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Feb 23, 2010 9:11 pm    Post subject: SFTP
Reply with quote

Hi Robert,

It is on my local machine (OMVS - Unix Partition of Mainframe Server)
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Feb 24, 2010 11:15 pm    Post subject: SFTP ...
Reply with quote

Hi Robert,
Any help on this ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Feb 24, 2010 11:45 pm    Post subject:
Reply with quote

Since the file is on the local machine, not the remote machine, using SFTP to do the rename will not work. SFTP rename is to rename a file on the server, not the client.

You can use the OMVS command mv to change the name of the Unix System Services file on the mainframe.

The syntax of the mv command can easily be found in the Unix System Services Command Reference manual or by using the man command in OMVS or via telnet session. I personally regard providing syntax of commands on a forum like this to be a waste of time -- my time since I already know where to find the syntax if I have questions, as well as the poster's time since if they are not willing to look up the syntax of the command in the manual then there's no motivation for them to learn anything on their own. With Google and IBM's various web sites, there's certainly no excuse for being unable to find command syntax.
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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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