jcl to ftp mainframe ps to .txt in windows

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
sasanka
Member
Posts: 19
Joined: Wed Dec 29, 2010 11:37 pm
Location: hyderabad

jcl to ftp mainframe ps to .txt in windows

Post by sasanka » Thu Dec 30, 2010 12:06 am

hi,
im new to this site,i've used the following jcl


/job......................
//step0 exec pgm=ftp,parm=' ...............' ftp server address '
//sysout dd sysout=*
//sysprint dd sysout=*
//sysin dd *

****** (project racf id) userid
given my email id in project password
pwd
ascii
cd c:\.............. (path where i want to keep file)
pwd
put 'dataset name in mf' ftp.txt
quit
/*


i've got maxcc=0 and also welcome msg that connected to server

but after password is accepted it is saying command failed

what password and userid should be specified im working in for banking project

i'm a fresher so help me

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

Post by MrSpock » Thu Dec 30, 2010 7:14 pm

I'll only offer a few comments:

1. Only the system admin of the FTP server you're connecting to can provide the userid/password details.

2. Why do you even need to know them? I'm suprised that your mainframe system admins don't have a protected file where they store all of the necessary userid/password details (identified by a //NETRC DD statement in the JCL).

3. It's usually a good idea to provide a SENDSITE command after you logon to suppress the transmission of SITE commands to the FTP server unless it absolutely requires them.

4. "cd c:\.............." doesn't look like a valid FTP "Change Directory" command to me. Go through the help commands on that server and see what they show, or check with the system admin. FTP users are rarely allowed to issue a "cd" command.

5. You don't have to "put" a dataset name. You can, if you want, "put" a reference to a DD name that, in turn, points to a dataset name. It's documented in the FTP section of the TCP/IP Users Guide.

6. Look into using the (Exit statement on the FTP program. You usually want to report back any problems or failures, and not just always accept a return-code of zero.
Last edited by MrSpock on Fri Dec 31, 2010 2:28 am, edited 1 time in total.

sasanka
Member
Posts: 19
Joined: Wed Dec 29, 2010 11:37 pm
Location: hyderabad

Post by sasanka » Thu Dec 30, 2010 10:48 pm

MrSpock wrote:I'll only offer a few comments:

1. Only the system admin of the FTP server you're connecting to can provide the userid/password details.

2. Why do you even need to know them? I'm suprised that your mainframe system admins don't have a protected file where they store all of the necessary userid/password details (identified by a //NETRC DD statement in the JCL).

3. It's usually a good idea to provide a SENDSITE command after you logon to suppress the transmission of SITE commands to the FTP server unless it absolutely requires them.

4. "cd c:\.............." doesn't look like a valid FTP "Change Directory" command to me. Go through the help commands on that server and see what they show, or check with the system admin. FTP users are rarely allowed to issue a "cd" command.

5. You don't have to "put" a dataset name. You can, if you want, "put" a reference to a DD name that, in turn, points to a dataset name. It's documented in the FTP section of the TCP/IP Users Guide.

thanks for your reply
i will contact system admin to know the user id and pass word
should there be anychanges i my program for successful ftp?

can i use this pgm to ftp ps to .xlsx sheet?

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

Post by MrSpock » Fri Dec 31, 2010 2:51 am

sasanka wrote:can i use this pgm to ftp ps to .xlsx sheet?
If I correctly understand that by the term ".xlsx" you're referring to the Microsoft Excel proprietary file format, then my answer is no unless you have software or a program you've written that can actually create the data in that format. Usually the best you can do is to create the data in some sort of a delimited-text format, symbolic-link format, or in HTML or XML.

sasanka
Member
Posts: 19
Joined: Wed Dec 29, 2010 11:37 pm
Location: hyderabad

Post by sasanka » Sat Jan 01, 2011 1:20 am

MrSpock wrote:
sasanka wrote:can i use this pgm to ftp ps to .xlsx sheet?
If I correctly understand that by the term ".xlsx" you're referring to the Microsoft Excel proprietary file format, then my answer is no unless you have software or a program you've written that can actually create the data in that format. Usually the best you can do is to create the data in some sort of a delimited-text format, symbolic-link format, or in HTML or XML.

can u provide a jcl program to do multiple ftp into ms excel sheet on windows from mainframes

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