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

Can any one give some ftp program written in jcl?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
csiva007

New User


Joined: 29 Sep 2005
Posts: 10

PostPosted: Thu Dec 01, 2005 10:59 am
Reply with quote

Can any one give some ftp program written in jcl?
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Dec 01, 2005 11:33 am
Reply with quote

FTP step in a JCL

Code:
//AAAB     EXEC PGM=FTP,                   
//            PARM='(EXIT',                 
//             COND=(0,NE)                 
//*                                         
//INPUT        DD  DSN=AAA.BBB.CCC.DDD,
//            DISP=SHR                     
//*                                         
//SYSPRINT     DD  SYSOUT=*                 



Input file AAA.BBB.CCC.DDD
Code:

ftp ipaddress
userd
password
cd location
put 'sending  file(created from the jcl )' receiving file
close
quit


hope this helps.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Dec 01, 2005 11:52 am
Reply with quote

Hi frnd,

i think v need to specify the 'bin' and 'quote site trail' command to put the file using FTP?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Dec 01, 2005 11:55 am
Reply with quote

Check here for more details publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B950/4.9?DT=20050708142126
Back to top
View user's profile Send private message
sathish_rathinam

New User


Joined: 22 Aug 2005
Posts: 59
Location: india

PostPosted: Thu Dec 01, 2005 12:13 pm
Reply with quote

hi khamarutheen,

BIN is coded only if u need to send the input file data in the binary format ,later at the receiving end they will encrypt it to normal data..

regards,
sathish
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Dec 01, 2005 12:19 pm
Reply with quote

Hi frnd,
Thank u for ur valuable information. let me correct it.
Back to top
View user's profile Send private message
gauravk

New User


Joined: 27 Feb 2006
Posts: 4
Location: Pune

PostPosted: Tue Feb 28, 2006 2:27 pm
Reply with quote

I tried using the above code provided by Radhakrishnan. I wanted to upload a file from my local machine to mainframe. But it gave me following error...

FTP: EXIT has been set.
Connect to ?
XXX.XX.XX.XXX
Connecting to: XXX.XX.XX.XXX port: 21.
recv error from getNextReply - EDC8128I Connection refused. (errno2=0x769F0442)
Connection with XXX.XX.XX.XXX terminated
*** Control connection with XXX.XX.XX.XXX dies.
Std Return Code = 10000, Error Code = 00008

I think this is happening because of some firewall settings. But I am able to upload/download files manually. i.e. using START --> 6 option from the local machine with the same id.

Could someone please guide me what needs to be done here?
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 Feb 28, 2006 7:31 pm
Reply with quote

gauravk, let me see if I understand you correctly:

You're saying that you can, from TSO, open up and log into an FTP session to the remote FTP server on port 21, yet on the exact same machine, submitting a job to run the same FTP process in the background, you're being denied access to the same server?

- Does your FTP session from TSO use the same RACF ID as the batch job? Could it be a security issue?

- Are you sure that the remote FTP server was active when this error occured? Is it possible that the FTPD daemon needs to be started on the remote server?

- You'll probably need a network engineer to run a diagnostic trace with a network sniffer. You don't have many diagnostic tools available, other than the normal ones like PING, TRACERTE, and NETSTAT.
Back to top
View user's profile Send private message
gauravk

New User


Joined: 27 Feb 2006
Posts: 4
Location: Pune

PostPosted: Wed Mar 01, 2006 4:31 pm
Reply with quote

Thanks for replying.
You have got it right. I am able to FTP the file from TSO. Following is the command getting submitted on TSO command line for this -

IND$FILE PUT '<host file name>' ASCII CRLF RECFM(V) LRECL(133)

Just a couple of doubts -
1. I need to connect to the local machine from host. So I have to specify ip address of my machine in the input file.
2. If this is a problem of FTP server not being active on my/remote machine then even the TSO command should fail.

Please let me know if above points are valid. Also specify how can I check which RACF IDs are getting used for batch job and FTP session from TSO.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Mar 01, 2006 4:44 pm
Reply with quote

IND$FILE is not the TSO FTP command. FTP is the TSO FTP command. IND$FILE has nothing to do with FTP. It is a proprietary, unsupported and undocumented file transfer mechanism that works between a 3270 emulation program and a PC. IND$FILE can only function if you are logged onto the mainframe host from the emulation software. There is no possibility of batch functionality.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Tue Mar 31, 2009 11:56 am
Reply with quote

Hi,

I am trying to upload a file by using the above JCL but unable to transfer the file.

The below file XK89.HT is a html file and I am trying to upload that report to my website.

Host name : ftp . 0fees . net or 209.190.85.248
User ID : FEES0_3240211
Password : XXYYZZ
-------------------------------
Not sure about this part..
I want to upload it to
Root/htdocs/ is the usage
Code:
cd \htdocs
correct?
-------------------------------



Code:
//XK89KAPA JOB ,'COPY TO DISK',CLASS=4,MSGCLASS=P,NOTIFY=&SYSUID 
//AAAB     EXEC PGM=FTP,PARM='(EXIT',COND=(0,NE)                 
//INPUT        DD  DSN=XK89.HT,DISP=SHR                           
//SYSPRINT     DD  SYSOUT=*                                       
  Use [URL] BBCode for External Links                                                   
  FEES0_3240211
   XXYYZZ                                         
  cd \htdocs\index.htm                                           
  close                                                           
  quit                                                           
/*   




I get the below error, I think its unable to find the host name not sure...

Code:
EZA1736I FTP (EXIT                                 
EZA1450I IBM FTP CS V1R9                           
EZA1772I FTP: EXIT has been set.                   
EZA1456I Connect to ?                             
EZA1736I EOD Timings from Priority Depots         
EZA2579E Usage error:  Valid parameters are:       
  ftp -e   host_name  port_number ( Exit           
                                    Exit=nn       
      -d                            TRACe         
      -w nn                         TImeout nn     
      -p tcpip                      TCP tcpip     
      -t dsn                        TRANslate dsn 
      -g                                           
      -i                                           
      -n                                           
      -v                                           
   



Tried the below link, but I get the same error


publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B950/4.9?DT=20050708142126 also has a similar syntax

Could you please shed some light..

Thanks in advance,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Mar 31, 2009 4:51 pm
Reply with quote

First, you're responding to a thread that has been inactive for 3 years.

Second, you may need a backslash or a forward slash in the cd -- it depends on whether you're going to a Windows server or a Unix server.

Third, the INPUT DD name contains the FTP commands, not the file you're trying to send.

Fourth, the JCL is
Code:
//FTP      EXEC PGM=FTP,
//         PARM='ftp.0fees.net (EXIT'
//SYSMDUMP DD   SYSOUT=*
//SYSPRINT DD   SYSOUT=*
//INPUT DD *
userid
password
cd \htdocs
put 'XK89.HT' <remote file name>
quit
/*
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Tue Mar 31, 2009 11:27 pm
Reply with quote

Hi Robert,

Many thanks for your time and the explanation. I corrected JCL accordingly.

I am trying to upload some reports from Mainframe (HTML format) to a webserver (ftp.0fees.net) --> free web hosting site

This FTP host(ftp.0fees.net) reponds if we use FTP softwares like Filezilla (PC) to upload files.

But if we try to ping the site from mainframes, it just does not respond,

I am very new to FTP. So having trouble with it.

The error that comes up is...


Code:
 IBM FTP CS V1R9                                                     
 Connect to ?                                                       
Use [URL] BBCode for External Links
 Connecting to: Use [URL] BBCode for External Links 75.102.35.59 port: 21.               
 Connection to server interrupted or timed out. Initial connection   
 Command:                                                           
   


Is this caused by some mainframe "FIREWALL" icon_eek.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Mar 31, 2009 11:30 pm
Reply with quote

why not ask Your support ??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Mar 31, 2009 11:40 pm
Reply with quote

Hello,

Use [URL] BBCode for External Links - Use [URL] BBCode for External Links icon_question.gif

Why are there 2 different sites in your post?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Mar 31, 2009 11:59 pm
Reply with quote

Connection timing out, especially before the initial handshaking is complete, is typically either a firewall issue (router blocking the connection) or the server isn't listening on port 21. It is rare in my experience for there to be a firewall running on a mainframe blocking access -- it's usually a router issue.

If you can't ping the server from the mainframe, I would tend to believe there's a network issue with a router preventing access. This is an issue you absolutely must talk to the network support group about since the precise problem and its resolution will depend upon your network setup. There are sites where mainframe access from the Internet is blocked for various reasons, so again your site network support group needs to be involved.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Wed Apr 01, 2009 1:17 am
Reply with quote

oh sorry.. I was trying with many free web hosting sites, so accidentally posted the other log.

I was unable to FTP to both the sites.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Wed Apr 01, 2009 1:23 am
Reply with quote

Quote:
Hello,

Use [URL] BBCode for External Links - Use [URL] BBCode for External Links icon_question.gif

Why are there 2 different sites in your post?



oh sorry.. I was trying with many free web hosting sites, so accidentally posted the other log.

I was unable to FTP to both the sites.




Thanks Robert, Its clear now that some network setup must be tuned. I will seek our NSG support.

On the other hand does mainframes really have a firewall?
icon_eek.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Apr 01, 2009 1:44 am
Reply with quote

Hello,

As far as i know, anything that uses tcp/ip can be setup behind a firewall.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top