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

FTP file from mainframe to multiple servers at same time


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 1:50 pm
Reply with quote

Hi,

Currently i am FTPing a file from mainframe to 3 different unix servers in JCL through 3 different steps. Each step will call a control card which had details about the destination server.

I want to eliminate these 3 steps in JCL. I need to FTP the file to 3 different servers at the same time in a single step. I wrote a REXX program which will dynamically create FTP control card which has details about 3 servers
I am invoking this FTP control card. When we run the JCL it successfully FTPs to the first server and then it quits automatically. It doesn’t FTP to the next server. It says invalid command. I am not sure if we can transfer a file to more than one server through the same control card.

Please let me know if it is possible and some idea on how should i proceed.

Thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 01, 2010 2:02 pm
Reply with quote

Is it possible to FTP to mulitple destinations?
Do you have a link to an FTP manual?
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 2:05 pm
Reply with quote

Sorry i couldnt get your question.
You can FTP a file to multiple different servers through different steps in JCL.

Do you have a link to an FTP manual? --- couldnt understand this
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 01, 2010 2:22 pm
Reply with quote

Is it even possible to FTP to multiple destinations (as with email) in a single step/FTP execution?
Do you have the FTP manual available to you to look this up?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Mon Mar 01, 2010 2:27 pm
Reply with quote

I think XCOM will do the job.
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 2:38 pm
Reply with quote

Is it even possible to FTP to multiple destinations (as with email) in a single step/FTP execution? ---> This is the question which i am asking here. If so any ideas on that

I dont have FTP manual
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 01, 2010 5:20 pm
Reply with quote

Yes, it is. Once FTP has started it can open and close sessions as many times as it needs to.
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 5:27 pm
Reply with quote

Could you please provide me some idea on how can i do this.

I had created a control card as below:

servername1
userid1
password1
send file using put command
quit
servername2
userid2
password2
send file using put command
quit

called this control card in the FTP step thru JCL.

It successfully FTPs to servername1. After that it doesnt recognize any command and says invalid command. Hence not able to ftp to servername2.

Please advise.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 01, 2010 5:50 pm
Reply with quote

You need to get rid of the quit statements (except for the last one).
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 5:57 pm
Reply with quote

I have tried that option. But it doesnt work.
coded as below:

servername1
userid1
password1
send file using put command

servername2
userid2
password2
send file using put command
quit

It FTPed to servername1 and then it threw error as invalid command for servername2, userid2,password2. Again it FTPed file to same servername1.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Mon Mar 01, 2010 6:04 pm
Reply with quote

Maybe put a "disconnect" or "close" between the following statements :

send file using put command

servername2
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 01, 2010 6:04 pm
Reply with quote

You DO need to close the sessions between servers:

CLose subcommand--Disconnect from a remote host.
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Mon Mar 01, 2010 6:24 pm
Reply with quote

I tried this option and it worked. Thanks all for your timely help.
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Tue Mar 02, 2010 9:49 am
Reply with quote

I have a doubt here. If the FTP of the first server failes will it still continue to FTP to the next server?
Is there a way to find out if the file was FTPed successfully in control card.
Back to top
View user's profile Send private message
shanuss

New User


Joined: 16 Jul 2008
Posts: 17
Location: Chennai

PostPosted: Tue Mar 02, 2010 11:37 am
Reply with quote

you can verify spool to see if there is any FTP failed statements.... Or you can issue a list command on to the servers once all FTPs are done
Back to top
View user's profile Send private message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Tue Mar 02, 2010 12:15 pm
Reply with quote

I tried failing the FTP of first server to see if the second server FTP runs succesfully. It didnt invoke the second server's FTP and it returned error code 1808.
My requirement is to successfully run FTP of the second server even if the first server FTP fails. Kindly provide me some pointers on how i can do this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 02, 2010 7:23 pm
Reply with quote

Run multiple steps or multiple jobs. If the first FTP does not complete successfully, then z/OS considers the step to have failed and will not execute any other FTP commands. So you cannot do what you want in a single step of a job.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Tue Mar 02, 2010 7:28 pm
Reply with quote

Once again XCOM will do the job.

Oh, I almost forgot. You have to have it installed of course.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 02, 2010 7:29 pm
Reply with quote

The funny thing is, I had been thinking about posting a comment to this that I didn't think it would be a good idea to do this because of exactly this issue.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Tue Mar 02, 2010 7:36 pm
Reply with quote

superk wrote:
The funny thing is, I had been thinking about posting a comment to this that I didn't think it would be a good idea to do this because of exactly this issue.


Hello Kevin,

i was thinking the same after my first response. But then as we speak
im bored like hell. Beside that i really get annoyed when people wont
understand if something is not working the way they would like, then you have to revert to other solutions given by you, others and last but not least myself.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top