MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FTP question - Mainframe from Linux server

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Sun Mar 18, 2018 9:59 am    Post subject: FTP question - Mainframe from Linux server Reply with quote

Hi,
A file is getting FTPied from mainframe to a Linux server to a particular directory. A Java process kicks off as soon as the file gets written into that particular directory and it starts processing the file before the full file gets FTPied. The Java process and FTP in mainframe is running concurrently. I wanted the JAVA process to run only after the file FTP was completed. So I created a new folder and FTPied the file and then wanted to rename/move the file into that particular directory which kicks off the Java process based on a particular name

/p01/app/test1/dba93/ecp is the directory - creation of file in the name dcert.txt kick off the Java process.
so i created a new folder in ecp and put the file name
Below are the Ftp commands in my JCL --
Code:

--pwd
/p01/app/test1/dba93/ecp
--cd test
--pwd
/p01/app/test1/dba93/ecp/test
--sput mainframe file dcert.txt
--cd
--rename /p01/app/test1/dba93/ecp/test/dcert.txt  dcert.txt

the rename fails with the below error.Error:
Code:

java.nio.file.NoSuchFileException: /p01/app/test1/dba93/ecp/test/dcert.txt

Please let me know what I am missing and if you have any other suggestions to accomplish this.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Mar 19, 2018 11:20 am    Post subject: Reply with quote

manu wrote:
rename /p01/app/test1/dba93/ecp/test/dcert.txt dcert.txt

manu,

aren't you renaming the file to the same file name?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Mon Mar 19, 2018 3:01 pm    Post subject: Reply with quote

Hi Kolusu,

It fails with the same error even if I give different file name. Basically I am Ftp'ing into one folder and want to move the file to the parent folder by FTP.I am putting the file in the below folder
/p01/app/test1/dba93/ecp/test
and want to move the file into
/p01/app/test1/dba93/ecp by using FTP from mainframe.

Any suggestions? Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Mar 19, 2018 5:18 pm    Post subject: Reply with quote

manu wrote:
Hi Kolusu,

It fails with the same error even if I give different file name. Basically I am Ftp'ing into one folder and want to move the file to the parent folder by FTP.I am putting the file in the below folder
/p01/app/test1/dba93/ecp/test
and want to move the file into
/p01/app/test1/dba93/ecp by using FTP from mainframe.


Any suggestions? Thanks.



manu,

I am confused. Your initial post shows a java error on rename and now you asking to move the file using FTP control cards?

If you are using Java 7 and higher then you can use Files.Move

something like this
Code:

Path source = "/p01/app/test1/dba93/ecp/test/dcert.txt"
Path newdir = "/p01/app/test1/dba93/ecp/dcert.txt"

Files.move(source, newdir.resolve(source.getFileName()), REPLACE_EXISTING);


or if you want to use renameto then use the example shown here

http://javatutorialhq.com/java/io/file-class-tutorial/renameto-method-example/
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Thu Mar 22, 2018 12:28 pm    Post subject: Reply with quote

That was the error message I got in the mainframe job log.I will check on it and let you know if I need anything. Thanks for your inputs on this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group