ftp Job



IBM's Command List programming language & Restructured Extended Executor

ftp Job

Postby fuuss » Thu Jan 14, 2010 2:47 pm

Hello

I have a small problem related with a few questions.

1) What I need to do
I need an Job that is executed in the USS of our Mainframe by a JCL from TWS ( no problem that works)
This job should be an FTP job taking the path and filesnames from a list ( I have created before by a JCL Job)
After Successfully sending the files to the FTp adress the files are getting renamed .
It's important that the files is only renamed if the tranfer worked.

2) Help I need
Is it possible to use Rexx for using FTp in the USS
If yes how should I manage it.
The job should start the connection and then sending the files in an if loop ,if this is done then directly renaming the file on the server and on the local

The list that should be imported is in this format

/T/webapp/logs/test/app1/Timestamp.deported.wasi-1.20091231.093923.log
/T/webapp/logs/test/app2/Timestamp.deported.wasi-1.20091231.093923.log
/T/webapp/logs/test/app2/Timestamp.wasi-2.20091229.225503.log

Even a better idea to resolve this problem would be good
any help is great
Thank you in advance

Christian
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ftp Job

Postby fuuss » Mon Jan 18, 2010 2:21 pm

or maybe somebody could say me how to use Ftp in a Rexx script , I searched the whole weekend but cannot find anything
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ftp Job

Postby Robert Sample » Mon Jan 18, 2010 11:03 pm

Google is your friend. Googling rexx ftp returned 571,000 hits of which several on the first page talk about using the FTP API in REXX that became available with z/OS 1.8 (and they're from IBM, even).
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: ftp Job

Postby fuuss » Tue Jan 19, 2010 3:51 pm

Ok FTPAPI was the great words I needed

I found somehint g, I post it here I may help somebody out there

/* rexx */
hostname = 'ftp.server.hostname'
username = 'userid'
password = 'passwd'
ftpapi_rc = FtpApi("fcai.", "create", "")
ftpapi_rc = FtpApi("fcai.", "init", "-w 300" hostname "21")
ftpapi_rc = FtpApi("fcai.", "scmd", "user" username, "W")
ftpapi_rc = FtpApi("fcai.", "scmd", "pass" password, "W")
ftpapi_rc = FtpApi("fcai.", "scmd", "cd directory", "W")
ftpapi_rc = FtpApi("fcai.", "scmd", "get file", "W")
ftpapi_rc = FtpApi("fcai.", "scmd", "QUIT", "W")
ftpapi_rc = FtpApi("fcai.", "term")
address syscall "sigaction" SIGCHLD SIG_DFL 0 "prevhndlr prevflag"
fuuss
 
Posts: 40
Joined: Wed Mar 19, 2008 3:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ftp Job

Postby dick scherrer » Wed Jan 20, 2010 12:12 am

Thank you for posting your code - it probably will help someone later :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CLIST & REXX