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 one file to three different servers????

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jul 06, 2005 4:15 pm    Post subject: FTP one file to three different servers???? Reply with quote

FTP one file to three different servers.

I need to transmit a flat file to three different servers thru FTP.any comments ???

//FTPKIIS1 EXEC PGM=FTP,REGION=2M,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=xxxxx.CNTLCARD(t),DISP=SHR
// DD DSN=xxxxx.CNTLCARD(t),DISP=SHR
// DD DSN=xxxxx.CNTLCARD(t),DISP=SHR
//OUTPUT DD SYSOUT=*
//*
******************************** Bottom of Data ********************************

CNTLCARD: xxxxx.CNTLCARD(TQ941A1C)
========
XXD01/BATCH.com
username password
ASCII
PUT 'xxxx.BILLEXTR.T.TABLE(0)' T.TXT
QUIT
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 06, 2005 4:51 pm    Post subject: Reply with quote

vak255,

I may be missing something here but isn't it as simple as running the above posted JCL as 3 steps each time changing the server name??

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jul 06, 2005 5:29 pm    Post subject: a new line Sysin dd * Reply with quote

a new line //Sysin dd * is inserted next to Job when i run this job and abended with Jcl error.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Jul 06, 2005 5:30 pm    Post subject: Reply with quote

STMT NO. MESSAGE
2 IEFC019I MISPLACED DD STATEMENT

this statement points to sysin statement which is generated.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 07, 2005 6:11 am    Post subject: Reply with quote

vak255,

Post your JCL that you tried to run.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 07, 2005 7:47 am    Post subject: JOB - JCL Reply with quote

Kolusu,If u have a jcl for this.pls post it.This is wht I run , the statement which is generated is in bold.


//KIRAN5FT JOB (BLPP,39U7,2,50),'FTP SERVER ',
// CLASS=A,NOTIFY=&SYSUID,MSGCLASS=E
IEFC653I SUBSTITUTION JCL - (BLPP,39U7,2,50),'FTP SERVER
//SYSIN DD * GENERATED STATEMENT
//FTPPUTS1 EXEC PGM=FTP,REGION=2M,PARM='(EXIT'
//NETRC DD DSN=AV9425.DE.JCL(USERPASS),DISP=SHR
//SYSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//INPUT DD *
***
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Jul 07, 2005 8:24 am    Post subject: Reply with quote

It can be accomplished in a single job, although it might make restart of a transmission failure more complicated:
Code:

//STEP0001 EXEC PGM=FTP,PARM='(Exit=8'             
//OUTPUT   DD   SYSOUT=*                           
//NETRC    DD   DISP=SHR,DSN=&SYSUID..NETRC       
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..MY.GDG(0)   
//INPUT    DD   *                                 
site1                             
sendsite                         
ascii                             
put //dd:sysut1 ftptest.txt       
close                             
open site2 21                     
sendsite                         
ascii                             
cd temp                           
put //dd:sysut1 ftptest.txt       
close                             
open site3 21                     
sendsite                         
ascii                             
cd temp                           
put //dd:sysut1 ftptest.txt       
close                             
quit                             
/*                               
//*                               
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu Jul 07, 2005 9:08 am    Post subject: Reply with quote

As requested please post the JCL that you submitted, do NOT post the JCL that shows up in SDSF. It appears you have a statement after the job card that is not recognized as a valid JCL statement so it is assumed to be sysin data.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 07, 2005 10:31 am    Post subject: Reply with quote

Thanks Superk, Kolusu and taltyman for all your help.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 07, 2005 10:41 am    Post subject: Reply with quote

superk/taltyman: this the jcl i used. Any comments r welcome.

JCL:
********************************* Top of Data **********************************
//SER1C JOB (G012,CPSC,9,99),'T FTP',
// SCHENV=SHORT
// JCLLIB ORDER=(SITEE.PROCLIB)
//**
//** EXECUTION JCL FOR FTP JCL
//**
//SER01 EXEC SER1C
//*
******************************** Bottom of Data ********************************

PROC:
********************************* Top of Data **********************************
//SER1C PROC
//**
//* THIS PROCEDURE TRANSFERS THE T TABLE TO THE SERVERS
//**
//*
//FTPPUTS1 EXEC PGM=FTP,REGION=2M,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=SITEE.CNTLCARD(SER1C),DISP=SHR
// DD DSN=SITEE.CNTLCARD(SER2C),DISP=SHR
// DD DSN=SITEE.CNTLCARD(SER3C),DISP=SHR
//OUTPUT DD SYSOUT=*
//*
******************************** Bottom of Data ********************************

CNTLCARD:
SITEE.CNTLCARD(SER1C)
********************************* Top of Data **********************************
SER1
username password
ASCII
PUT 'SITEE.BILLEXTR.TFIT.TABLE(0)' T.TXT
QUIT
******************************** Bottom of Data ********************************

SITEE.CNTLCARD(SER2C)
********************************* Top of Data **********************************
SER2
username password
ASCII
PUT 'SITEE.BILLEXTR.TFIT.TABLE(0)' T.TXT
QUIT
******************************** Bottom of Data ********************************

SITEE.CNTLCARD(SER3C)
********************************* Top of Data **********************************
SER3
username password
ASCII
PUT 'SITEE.BILLEXTR.TFIT.TABLE(0)' T.TXT
QUIT
******************************** Bottom of Data ********************************
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 07, 2005 10:54 am    Post subject: Reply with quote

superk,
Do u think I need to start with "sendsite" before entering userid and password.U just 'close' the connection and Quit only at last.what is the need to 'cd temp' . Pls explain.
Quote:

sendsite
ascii
cd temp
put //dd:sysut1 ftptest.txt
close
quit
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Jul 07, 2005 1:29 pm    Post subject: Reply with quote

A couple of points:

1. Your JCL and PROC is working fine at my site. I see nothing wrong.

2. The use of SENDSITE command to turn OFF or ON the SITE command needs to be determined on a per-server basis. A lot of FTP servers don't support the SITE command.

3. In the example I gave, that particular server only allows data to be "put" into files in the temp folder, so that's why I need to "cd temp" first.

4. The "quit" command caused the FTP program to stop reading any more input through the INPUT DD, so only use it once at the very end. The first two control cards need to end with a "close" command.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Jul 07, 2005 1:30 pm    Post subject: Reply with quote

A couple of points:

1. Your JCL and PROC is working fine at my site. I see nothing wrong.

2. The use of SENDSITE command to turn OFF or ON the SITE command needs to be determined on a per-server basis. A lot of FTP servers don't support the SITE command.

3. In the example I gave, that particular server only allows data to be "put" into files in the temp folder, so that's why I need to "cd temp" first.

4. The "quit" command caused the FTP program to stop reading any more input through the INPUT DD, so only use it once at the very end. The first two control cards need to end with a "close" command.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Jul 07, 2005 2:21 pm    Post subject: Reply with quote

Its marvelous and Thanks a lot superk....ure simply super at FTP.
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 -> Job Control Language(JCL) 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