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
 

 

FTP file from mainframe to multiple servers at same time

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: FTP file from mainframe to multiple servers at same time
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 01, 2010 2:02 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Mar 01, 2010 2:22 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Mar 01, 2010 2:27 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Mar 01, 2010 5:20 pm    Post subject: Reply to: FTP file from mainframe to multiple servers at sam
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Mar 01, 2010 5:50 pm    Post subject: Reply to: FTP file from mainframe to multiple servers at sam
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Mar 01, 2010 6:04 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Mar 01, 2010 6:04 pm    Post subject: Reply to: FTP file from mainframe to multiple servers at sam
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    Post subject:
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    Post subject:
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    Post subject: Reply to: FTP file from mainframe to multiple servers at sam
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    Post subject:
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: 7905
Location: Bellevue, IA

PostPosted: Tue Mar 02, 2010 7:23 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Mar 02, 2010 7:28 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Mar 02, 2010 7:29 pm    Post subject: Reply to: FTP file from mainframe to multiple servers at sam
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Mar 02, 2010 7:36 pm    Post subject: Re: Reply to: FTP file from mainframe to multiple servers at
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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