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

SFTP from mainframe to UNIX


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VenkateshMuthiyalu

New User


Joined: 11 Sep 2006
Posts: 4

PostPosted: Fri Oct 19, 2007 3:41 pm
Reply with quote

Anyone has sample JCL for Secure FTP which ftps data from mainframe to unix systems?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Oct 19, 2007 4:33 pm
Reply with quote

Start here with this previous topic.
Back to top
View user's profile Send private message
VenkateshMuthiyalu

New User


Joined: 11 Sep 2006
Posts: 4

PostPosted: Fri Oct 19, 2007 4:39 pm
Reply with quote

That link contain only the explanation. But JCl is not there. Any one provide the JCL for this with explanation..
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 Oct 23, 2007 10:07 am
Reply with quote

VenkateshMuthiyalu, that is how these Forums operate. Had the original poster provided some follow-up, maybe there'd be more information to go on. Hopefully, as you discover what needs to be done, you can provide your follow-up so the next poster can benefit.
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 Oct 23, 2007 10:20 am
Reply with quote

I just found a website with an SFTP example job:

itc.virginia.edu/mss/OpenSSH.html
Back to top
View user's profile Send private message
Jeevasuthan
Currently Banned

New User


Joined: 19 Oct 2007
Posts: 2
Location: India

PostPosted: Tue Oct 23, 2007 1:41 pm
Reply with quote

Hi Kevin

i just saw that link. Can you explain the working of this JCL

//STEPNAME EXEC PGM=BPXBATCH,
// PARM='sh sftp -b sftp-batch userid@is-delphi.admin.virginia.edu'
//SYSPRINT DD SYSOUT=*
//STDOUT DD PATH='/home/userid/bpxout.txt',
// PATHOPTS=(OCREAT,OTRUNC,OWRONLY),PATHMODE=SIRWXU
//STDERR DD PATH='/home/userid/bpxerr.txt',
// PATHOPTS=(OCREAT,OTRUNC,OWRONLY),PATHMODE=SIRWXU
//

/home/userid/sftp-batch on mercury contains:
cd /home/userid
lcd /home/userid
pwd
lpwd
ascii
put hello.c
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 Oct 24, 2007 1:22 am
Reply with quote

Jeevasuthan wrote:

Can you explain the working of this JCL

//STEPNAME EXEC PGM=BPXBATCH,
// PARM='sh sftp -b sftp-batch userid@is-delphi.admin.virginia.edu'
//SYSPRINT DD SYSOUT=*
//STDOUT DD PATH='/home/userid/bpxout.txt',
// PATHOPTS=(OCREAT,OTRUNC,OWRONLY),PATHMODE=SIRWXU
//STDERR DD PATH='/home/userid/bpxerr.txt',
// PATHOPTS=(OCREAT,OTRUNC,OWRONLY),PATHMODE=SIRWXU
//


I'm no Unix expert, but ...

PGM=BPXBATCH is the MVS to Unix interface program. You can see more information here in the 11.2 The BPXBATCH utility from the z/OS V1R8.0 UNIX System Services User's Guide.

PARM='sh sftp -b sftp-batch ... tells BPXBATCH to run the shell command "sftp". The "-b" switch tells sftp to use the batch file "sftp-batch" for its input. The next parameter would be the TCP/IP address of the Unix server to connect to.

STDOUT and STDERR are your standard-output and standard-error designations.
Back to top
View user's profile Send private message
Jeevasuthan
Currently Banned

New User


Joined: 19 Oct 2007
Posts: 2
Location: India

PostPosted: Wed Oct 24, 2007 9:21 am
Reply with quote

Thanks Kevin.

home/userid/sftp-batch on mercury contains:
cd /home/userid
lcd /home/userid
pwd
lpwd
ascii
put hello.c

IF i am correct the above mentioned script are to be written in the sftp-batch file in unix to SFTP the file name hello.c.
I went through the BXPBATCH UTILITY. Their its given that we have mention about STDENV. Can you guide me about STDENV.
Back to top
View user's profile Send private message
autobox

New User


Joined: 19 Aug 2005
Posts: 51

PostPosted: Thu Aug 26, 2010 3:43 pm
Reply with quote

Hi,

If I want to user USERID/PWD in the JCL above, where to code the USERID and PASSWORD?

Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Aug 26, 2010 5:17 pm
Reply with quote

Quote:
Can you guide me about STDENV.
From the manual Unix System Services User's Guide, which contains a lot about BPXBATCH:
Quote:
| 11.2.3 Passing environment variables to BPXBATCH

When you are using BPXBATCH to run a program, you typically pass the program a file that sets the environment variables. If you do not pass an environment variable file when running a program with BPXBATCH, or if the HOME and LOGNAME variables are not set in the environment variable file, those two variables are set from your logon RACF profile. LOGNAME is set to the user name, and HOME is set to the initial working directory from the RACF profile.

Note: When using BPXBATCH with the SH option (SH is the default), environment variables specified in the STDENV DD are overridden by those specified in /etc/profile and .profile (which overrides /etc/profile). This is because SH causes BPXBATCH to execute a login shell that runs the /etc/profile script and runs the user's .profile.

To pass environment variables to BPXBATCH, you define a file containing the variable definitions and allocate it to the STDENV ddname. The file can be one of the following:

* A z/OS UNIX file identified with the ddname STDENV
* An MVS data set identified with the ddname STDENV
There is more in the manual about the details, but you can read it yourself.
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 Aug 26, 2010 7:38 pm
Reply with quote

autobox wrote:
Hi,

If I want to user USERID/PWD in the JCL above, where to code the USERID and PASSWORD?

Thanks.


I don't know. I can't find any documentation that supports the concept of sub-commands for providing a userid and/or password for SFTP. I belive that's because the user authentification takes place when the connection is first made between the client and server.

Maybe someone more familiar with Unix and/or SFTP will know.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top