We do batch ssh transfers everyday using IBM's Ported Tools, here is a sample batch job:
//********************************************************************** //* STEPS TO EXECUTE SFTP USING PARAMETERS DYNAMICALLY CREATED IN PDLSDG //********************************************************************** //PDLSDI10 EXEC PGM=IEBGENER //SYSPRINT DD DUMMY //SYSIN DD DUMMY //SYSUT2 DD PATH='/tmp/sftp',FILEDATA=TEXT, // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //SYSUT1 DD DSN=&SFTPPARM,DISP=SHR //* //PDLSDI15 EXEC PGM=BPXBATCH, // PARM='SH sftp -b /tmp/sftp -F /gwc/ssh/config // [EMAIL PROTECTED]' //STDOUT DD PATH='/tmp/&SYSUID..STDOUT', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU //STDENV DD DSN=FGC.GC.LOS.TMPR.SFTP.PWPARMS,DISP=SHR //* //PDLSDI20 EXEC PGM=IEBGENER //SYSPRINT DD DUMMY //SYSIN DD DUMMY //SYSUT1 DD PATH='/tmp/&SYSUID..STDOUT', // FILEDATA=TEXT,PATHOPTS=ORDONLY,PATHDISP=DELETE, // RECFM=VB,LRECL=255,BLKSIZE=27998 //DELETE DD PATH='/tmp/sftp', // FILEDATA=TEXT,PATHOPTS=ORDONLY,PATHDISP=DELETE, // RECFM=VB,LRECL=255,BLKSIZE=27998 //SYSUT2 DD SYSOUT=* //* Here is a sample for Contents of dataset FGC.GC.LOS.TMPR.SFTP.PWPARMS DISPLAY=FOO SSH_ASKPASS=/etc/ssh/ussfile.psw.sh Here is a sample for the get parms: lcd .. ascii get GWCC.ACK.20080221 /tmp/pmierr.txt rename GWCC.ACK.20080221 GWCC.ACK.20080221.PRC !cp /tmp/pmierr.txt "//'FGC.GC.LOS.PROD.PMI.ERROR.FILE'" !rm /tmp/pmierr.txt rm GWCC.ACK.200712* quit I also have manuals, please contact me and I will send you a copy of the IBM Ported Tools manauls. And some other doc if you want it. Also open an ETR with IBM and they were very helpful getting this to work. Bill Miller Great West Casualty Company 1100 West 29th Street South Sioux City, NE 68776 Phone: 402-494-7354 Email: [EMAIL PROTECTED] -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Jon Brock Sent: Friday, February 22, 2008 10:17 AM To: [email protected] Subject: Batch job to perform sftp transfer WE have a need to begin electronically sending data to a state agency which has formerly received a tape from us. They have set up an sftp server on their end and given us the user ID and password they want us to use. I can sign on to their site from Windows and from a Linux guest hosted on our mainframe but I have not so far been able to sign on from z/OS. It is not possible to start an ssh session from within OMVS under TSO. Presumably, we should be able to start sshd and sign on from a client session, but that entails some security work which has not been performed. (Given the workload on our security guy, I don't look for it any time soon, either.) This makes testing and experimenting slow. Ideally, I would like to be able to set up a batch job that can be run under scheduler control to transmit this file when it is generated. If I am reading the correct information, though, it is not possible to do this in batch mode using ID/password authentication. Can anyone say whether this is correct? Am I going to need to get the remote server to add our keys to their setup? Thanks, Jon ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ##################################################################################### Attention: The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. (GWCC) ##################################################################################### ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

