IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we rename a file using SFTP


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 23, 2010 9:10 pm
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
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 24, 2010 11:45 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top