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
 

 

Can any one give some ftp program written in jcl?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Can any one give some ftp program written in jcl?
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: 436
Location: chennai, India

PostPosted: Thu Dec 01, 2005 11:33 am    Post subject:
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: 680
Location: NJ

PostPosted: Thu Dec 01, 2005 11:52 am    Post subject: FTP
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

Moderator Team Head


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

PostPosted: Thu Dec 01, 2005 11:55 am    Post subject: Re: Can any one give some ftp program written in jcl?
Reply with quote

Check here for more details http://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    Post subject: Re: Can any one give some ftp program written in jcl?
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: 680
Location: NJ

PostPosted: Thu Dec 01, 2005 12:19 pm    Post subject: FTP in JCL
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    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Feb 28, 2006 7:31 pm    Post subject: Re: Can any one give some ftp program written in jcl?
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    Post subject: superk
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

Moderator Team Head


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

PostPosted: Wed Mar 01, 2006 4:44 pm    Post subject: Re: Can any one give some ftp program written in jcl?
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: 1445
Location: Azeroth

PostPosted: Tue Mar 31, 2009 11:56 am    Post subject:
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=*                                       
  ftp.0fees.net                                                   
  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


http://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: 7904
Location: Bellevue, IA

PostPosted: Tue Mar 31, 2009 4:51 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Tue Mar 31, 2009 11:27 pm    Post subject:
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 ?                                                       
FTP.250FREE.COM
 Connecting to: FTP.250FREE.COM 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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Mar 31, 2009 11:30 pm    Post subject: Reply to: Can any one give some ftp program written in jcl?
Reply with quote

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

Site Director


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

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

Hello,

ftp.0fees.net - FTP.250FREE.COM 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: 7904
Location: Bellevue, IA

PostPosted: Tue Mar 31, 2009 11:59 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Wed Apr 01, 2009 1:17 am    Post subject:
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: 1445
Location: Azeroth

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

Quote:
Hello,

ftp.0fees.net - FTP.250FREE.COM 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

Site Director


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

PostPosted: Wed Apr 01, 2009 1:44 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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