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 

Need a FTP JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 525
Topics: 89
Location: Bangalore India

PostPosted: Wed Aug 22, 2007 6:22 am    Post subject: Need a FTP JCL Reply with quote

Hai All,

We have two TSO regions A - Test and B - Prod.I have a dataset which i can xmit it from Prod - Unit and from Unit - Prod by using XMIT command.I would like to know if it is possible by invoking any FTP job (PGM=FTP) i can trasnmit the dataset vice-versa, if possible can anybody share the JCL which will do the transmission either way.Thanks.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 22, 2007 6:43 am    Post subject: Reply with quote

shekar123,

try this jcl


Code:

//STEP0100 EXEC PGM=FTP                         
//SYSPRINT DD SYSOUT=*                           
//INPUT    DD *                                 
ip addr of prod datacenter
userid                                         
password                                         
LOCSITE LRECL=nnn                               
LOCSITE BLKSIZE=nnnnn                             
LOCSITE RECFM=FB                                 
PUT 'your test ftp file'  'your prod ftp file'
//OUTUT    DD SYSOUT=*                           
//*                                         


Here is a simple rexx exec to find the ip address

Code:

/* REXX */                                                 
PARSE VALUE SOCKET('INITIALIZE', 'TEST') WITH RC . . SERVER
PARSE VALUE SOCKET('GETHOSTID') WITH RC IP                 
SAY IP                                                     
EXIT       


Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 22 Jul 2005
Posts: 525
Topics: 89
Location: Bangalore India

PostPosted: Wed Aug 22, 2007 7:22 am    Post subject: Reply with quote

Kolusu,

Thanks for your reply. I need some clarifications from your JCL:
Say if i want to FTP a dataset SHEKAR.TEST.PROD which is present in REGION B and which is not present in REGION A , so as per u JCL i have to give:
Code:

//STEP0100 EXEC PGM=FTP                                                 
//SYSPRINT DD SYSOUT=*                                                 
//INPUT    DD *                                                         
1.2.3.4                   IP ADDRESS OF PROD SERVER                     
SHEKAR                    TSO ID OF PROD REGION B                       
XXXXXX                    PASSWORD OF PROD REGION B                     
LOCSITE LRECL=80          LRECL OF SHEKAR.TEST.PROD                     
LOCSITE BLKSIZE=800       BLKSIZE OF SHEKAR.TEST.PROD                   
LOCSITE RECFM=FB          RECFM OF SHEKAR.TEST.PROD                     
PUT 'SHEKAR.TEST.TEST'    'SHEKAR.TEST.PROD'                           
//OUTUT    DD SYSOUT=*                                                 
//*                                                                     
//                                                                         

Can you let me know what is the significance of 'your test ftp file' , is the desired dataset name which u want in TSO REGION A ?
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 22, 2007 7:31 am    Post subject: Reply with quote

Quote:

PUT 'SHEKAR.TEST.TEST' 'SHEKAR.TEST.PROD'


shekar123,

Code:

PUT 'your sending file name here'    'your target file name name'


In simple terms 'SHEKAR.TEST.TEST' will be ftp'd to another mainframe datacenter and will be saved as 'SHEKAR.TEST.PROD'

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 22 Jul 2005
Posts: 525
Topics: 89
Location: Bangalore India

PostPosted: Wed Aug 22, 2007 7:57 am    Post subject: Reply with quote

Kolusu,

I am clear by your wordings and the JCL is working fine and i checked the spool and i was able to understand.But i am finding a strange thing the dataset is not FTPed to REGION A , rather the dataset is FTPed in the same Region B only.After the job has run i found the two datasets in REGION B only:
Code:

SHEKAR.TEST.TEST
SHEKAR.TEST.PROD

Moreover i have a question without giving the IP address of REGION A how the dataset will be FTPed to a seperate Region.Please clarify me.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 22, 2007 8:02 am    Post subject: Reply with quote

Quote:

But i am finding a strange thing the dataset is not FTPed to REGION A , rather the dataset is FTPed in the same Region B only.After the job has run i found the two datasets in REGION B only:

shekar123,

You might have the IP address of region B itself. Login to your Region A and extract the IP address using the rexx exec.

Quote:

Moreover i have a question without giving the IP address of REGION A how the dataset will be FTPed to a seperate Region.Please clarify me.


You will need the server name or the Hostname to FTP without using the Ip address

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 22 Jul 2005
Posts: 525
Topics: 89
Location: Bangalore India

PostPosted: Wed Aug 22, 2007 8:13 am    Post subject: Reply with quote

Kolusu,

Thanks all the way for u help and i am able to FTP from PROD to Test , i was actually running the job in Prod Region giving the IP of PROD region itself. You are great.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Mon Jul 06, 2009 2:55 am    Post subject: Reply with quote

Hi kolusu,

I executed the following JCL,
//STEP01 EXEC PGM=FTP,PARM='(EXIT'
//******************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=DATA.SET
//INPUT DD *
10.158.13.77
ID
PWD
LOCSITE LRECL=80
LOCSITE BLKSIZE=27920
LOCSITE RECFM=FB
PUT //DD.SYSUT1 test.txt
QUIT
//OUTUT DD SYSOUT=*

But, it ended with error MAXCC=1808....

I checked the error its says that the FTP is not set up in your session. But when I tried ftping the file using command prompt it is working fine.

So when i am trying to ftp the file from mainframe to window it is throwing error but when i connect the mainframe from windows and ftp the file it is going good....

Can anybody help me in this regard...

Thanks In advance...
Manoj
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Jul 06, 2009 4:25 am    Post subject: Reply with quote

computer wrote:
... when I tried ftping the file using command prompt it is working fine.


So what is it that you're doing differently here? Are you using the correct TCP/IP Address or Domain Name for your desktop FTP server?

computer wrote:
So when i am trying to ftp the file from mainframe to window it is throwing error but when i connect the mainframe from windows and ftp the file it is going good.


Huh? It's not clear what the difference here is.

Could you paste a copy of your TSO session using the FTP interactively vs. a copy of the job output showing the error?
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Jul 06, 2009 6:43 am    Post subject: Reply with quote

Computer, I just realized that it is not a good idea to post your real tcpip adress, if you have a security leak somebody could misuse it, or do I see that wrong?
Back to top
View user's profile Send private message Visit poster's website
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Mon Jul 06, 2009 9:48 am    Post subject: Reply with quote

Hi Wrap5...the Ip I posted is an dummmy one...I wrote it randomly...

Thanks for making me cautious
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Mon Jul 06, 2009 9:50 am    Post subject: Reply with quote

Here is the error listing i found,

FTP (EXIT
Using /etc/ftp.data for local site configuration parameters.
IBM FTP CS V1R8
FTP: using TCPJSF
FTP: EXIT has been set.
Connect to ?
IP
Invalid port number. Open fails.

STEP WAS EXECUTED - COND CODE 1808
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 -> TSO and ISPF 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