JCL-I need to FTP from MF to Local computer

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
mgypraveen
Member
Posts: 12
Joined: Tue Oct 14, 2008 12:15 pm

JCL-I need to FTP from MF to Local computer

Post by mgypraveen » Wed Aug 19, 2009 5:09 pm

I need to FTP a CSV/.txt file from the Maniframe to Local machine.
I DONT want to FTP to Abacus then to Local machine But I need directly to loacla machine.

It will be great if some one has a tested script that I can use.

Thanks
Praveen

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Aug 19, 2009 5:11 pm

Can you show us an output trace or log showing your current FTP session to your "Local Machine"? You can X out any sensitive details such as the TCP/IP address and the logon/password details.

mgypraveen
Member
Posts: 12
Joined: Tue Oct 14, 2008 12:15 pm

Post by mgypraveen » Wed Aug 19, 2009 5:27 pm

Belwo script I use to download
ATTRALL.csv file form Guts to Abacus.
then We use Ftp window to Download...

open iri1
user <ID> <PWD>

ASCII
get 'XXXXX.DICT.ATTRALL' /XXX/xxxx/ATTRALL.csv

close

quit

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Aug 19, 2009 5:35 pm

I don't care about Abacus. I asked for a copy of an FTP session from the mainframe to this "Local Machine". I'd like to see some proof that you have the RACF or ACF/2 authority to execute FTP (doubtful) and that this "Local Machine" is configured for FTP access with a static TCP/IP address and/or domain name (again, doubtful), has an active FTP daemon, that you have an appropriate access logon id and password, and that your network configuration will allow the connection between the two machines.

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Aug 19, 2009 5:48 pm

Also, I'd like to know what your site's standards are for passing logon and password information across the network for FTP. Usually those details should be protected from unauthorized users, unless you allow anonymous FTP access.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Aug 19, 2009 6:16 pm

I agree with MrSpock -- You probably cannot send a file from the mainframe to your PC using FTP via a batch job (JCL) unless your PC is running as a(n) "FTP server" so the mainframe could connect; using personal PC as FTP server is most unlikely.
Last edited by Anuj Dhawan on Thu Aug 20, 2009 10:33 am, edited 1 time in total.
Regards,
Anuj

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Aug 19, 2009 6:19 pm

Anyway, you'll find all the details you need to know about the z/OS implementation of FTP in the z/OS V1R9.0 Comm Svr: IP User's Guide and Commands manual.

There's a sample FTP batch job on this page.

The basic format is:

//STEPNAME EXEC PGM=FTP,PARM='x.xx.xx.x 21 (EXIT'

where x.xx.xx.x is the TCP/IP address or domain name of the FTP server you are connecting to. 21 is the port number, and that is a standard port number for FTP, but it can vary so check with the Admin for your FTP server. You can direct FTP to exit on error with a nonzero return code by specifying the EXIT or EXIT=nn parameter on the FTP command.

//NETRC DD DSN=HLQ.NETRC,DISP=SHR

You can use the NETRC dataset, as defined by the NETRC DD statement , to identify the user ID and password for a batch-processed remote login. You can also specify the user ID and password in the INPUT DD data set.

//SYSFTPD DD DSN=HLQ.FTP.DATA

is an optional DD for a dataset that contains default configuration settings for FTP sessions.

//OUTPUT DD SYSOUT=*

Standard DD for your output messages. You can use SYSPRINT DD in place of the OUTPUT DD statement.

//INPUT DD

Specifies the input FTP commands.

A typical FTP input datastream might consist of the following commands:

>userid (if not already supplied in the NETRC dataset)
>password (ditto)
>sendsite (turn off the SITE command)
>ls (list files on the server)
>dir (directory of files on the server)
>cd (change directory on the server)
>lcd (change directory on the local site)
>put local-file target-file
>get target-file local-file
>quit

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others