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
 

 

How to move files from one folder to another on FTP server?

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

New User


Joined: 23 May 2006
Posts: 6
Location: Cincinnati

PostPosted: Thu Oct 28, 2010 7:40 am    Post subject: How to move files from one folder to another on FTP server?
Reply with quote

I need some help to move files from one folder to another on the remote server. These files are text files on the remote server that we GET and process them through a job. Once processing is done we want to move them to another folder on the same server so that our vendor can park files for next day's processing. Is there any FTP command that does this move? In addition to moving to another folder we want to rename the files.
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: Thu Oct 28, 2010 7:52 am    Post subject:
Reply with quote

Hello,

Why not just keep them on the mainframe after they are received/processed? Why do they need to remain on the remote server?

A couple of thoughts come to mind:

Have the remote system copy them when they are created and have the ftp job delete them from the original directory.

Have the mainframe ftp them to some other directory on the remote server after they have been received.

These aren't suggestions but are just something to get the thought process going.
Back to top
View user's profile Send private message
selvamsrinivasan85

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Tue Nov 09, 2010 11:15 pm    Post subject: Reply to: How to move files from one folder to another on FT
Reply with quote

Hi,

Move command for moving the txt file from one folder to another,
only if the folders are in the same directory/sub-directory:

Sample:
mv *.txt done <- * specifies all txt files
mv srini.txt done
- done is the folder in which txt files are moved.

once moved verify the folder whether particular txt file is present or not by using the below command.

ls done
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Nov 09, 2010 11:35 pm    Post subject:
Reply with quote

S.Srinivasan, please tell me where in the Communications Server bookshelf you find the MV command for FTP -- I don't see it when I look. MV is a Unix command, which is not valid to use in FTP as this script shows:
Code:
 EZA1772I FTP: EXIT has been set.
 EZA1554I Connecting to: ftp1.xxx.com xxx.xxx.xxx.xxx port: 21.
 220 ftp1.xxx.com NcFTPd Server (licensed copy) ready.
 EZA1701I >>> USER xxxxxxxx
 331 User xxxxxxxx okay, need password.
 EZA1701I >>> PASS
 230-You are user #20 of 100 simultaneous users allowed.
 230-
 230 Restricted user logged in.
 EZA1460I Command:
 EZA1736I mv a b
 EZA1618I Unknown command: 'mv'
Since the original request was for an FTP command, your "solution" fails completely to satisfy the requirement.

Indianblues, you can either use REXEC to execute a script on the remote server to perform the needed operations as a separate step in your job after the FTP step completes, or you can follow one of Dick's suggestions. But there's not really any way using FTP to do moves and renames since FTP is for file transfers, not remote access.
Back to top
View user's profile Send private message
selvamsrinivasan85

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Wed Nov 10, 2010 6:16 pm    Post subject: Reply to: How to move files from one folder to another on FT
Reply with quote

Hi Robert,

You are right. mv is a unix command and cannot be used in FTP. I am little bit confused as i am working on both these things.

So here is the answer:

First connect to Server using FTP.

Step1:
First use lcd command to set the local working directory of your machine. For example, if your text files are reside in d:\user directory use the below command
ftp> lcd d:\user

Step2:
Use cd command to set the working directory on the remote machine/server. Sample one is given below
ftp> cd /tmp

Step3:
Type ascii, as you are going to move only text files. if you want to move binary files type binary.
ftp> ascii

Step4:
Move the text files... icon_smile.gif
ftp> mput *.txt < for moving all txt files
ftp> put srini.txt < for moving text file named srini.

Step5:
use dir command to verify the moved files
ftp> dir *.txt < to verify all txt files
ftp> dir /user/local/bin < to verify files on particular directory of remote machine.
Back to top
View user's profile Send private message
selvamsrinivasan85

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Wed Nov 10, 2010 6:34 pm    Post subject: Reply to: How to move files from one folder to another on FT
Reply with quote

Hi,

Forget to mention. If you want to rename files, you have to get the files from the server to your local machine first. then, rename it and move to the server back.

command for receiving files.

ftp> mget *.txt < for receiving all text files to your local machine.
ftp> get srini.txt
ftp> get /user/srini.txt
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2429
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 10, 2010 7:40 pm    Post subject:
Reply with quote

Is it only me being utterly flabbergasted by using a mainframe to move
files on unix/windows or any other non mainframe box around?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Wed Nov 10, 2010 8:18 pm    Post subject:
Reply with quote

Of course it's only you; the rest of us realized long ago that PCs are useless toys icon_wink.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2429
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 10, 2010 8:21 pm    Post subject:
Reply with quote

Akatsukami wrote:
Of course it's only you; the rest of us realized long ago that PCs are useless toys icon_wink.gif
36_2_35.gif

Thats why im using mainframe FTP to comment on this site.
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm


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