Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

Using SFTP in Batch Mode on OpenVMS

Go to solution
Joseph J. Affrunti
Occasional Visitor

Using SFTP in Batch Mode on OpenVMS


I'm trying to get an SFTP command to work in a VMS batch job. The command format is as follows:

$ SFTP -v "-B" abc@xyz

where "abc" is a valid user name and "xyz" is a valid node name.

Public key authentication is set on both nodes. The client node is an Itanium running OpenVMS 8.2. The server node is a Linux machine. This command works correctly when entered at an interactive DCL level, but fails when run as a VMS batch job (i.e., job submitted to a VMS batch queue.) The error being returned is:

Error: Could not read the batchfile.

The protection on the input file is

Any help would be appreciated. Thank you.
John Travell
Valued Contributor

Re: Using SFTP in Batch Mode on OpenVMS

Does the information in threadId 985928 help ?

Steven Schweda
Honored Contributor

Re: Using SFTP in Batch Mode on OpenVMS

With all the disguising of the command
details, it's hard to tell if the
"" is valid from the default
directory for the batch job, which might
easily be different from your interactive
default directory. If it's some relative
spec and the default directories are
different, the explanation could be pretty

What, exactly, are "" and the two
default device-directory specs?
Joseph J. Affrunti
Occasional Visitor

Re: Using SFTP in Batch Mode on OpenVMS

Thanks for your reply.

I had seen this entry before. There doesn't seem to be any problem with authentication. The -v swith puts out verbose information and we can see from it that the client is successfully connecting to the server. The problem seems to be that when running as a batch job, the client (I think) cannot read the input file. Unfortunately, it doesn't put out any indication as to why it can't read the file.

Joseph J. Affrunti
Occasional Visitor

Re: Using SFTP in Batch Mode on OpenVMS

The actual command is:

$ SFTP -v "-B" SYS$SYSROOT:[SYSMGR]Filex.txt user1@lnx32
Steven Schweda
Honored Contributor

Re: Using SFTP in Batch Mode on OpenVMS

This works interactively for you?

Around here, I see only "Error: Could not
read the batchfile."

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 6
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2

alp $ ssh "-V"
alp$dka0:[sys0.syscommon.][sysexe]tcpip$ssh_ssh2.exe: SSH Secure Shell OpenVMS (
V5.5) 3.2.0 on COMPAQ Professional Workstation - VMS V7.3-2

On the other hand, I get some success if I
specify the batch file using a UNIX-like

However, if that file is not "Record format:
Stream_LF", then SFTP appears to try to
convert it (in place, more or less), and if
run by some peon without write permission to
that directory (or file?), it fails with
something like:

Warning: Converting file /sys$manager/filex.txt to Stream_LF.
openvms_specific/OPENVMS_SPECIFIC.C:1911: Error calling CONV$CONVERT for /sys$manager/filex.txt.
Status = %CONV-F-OPENOUT, error opening !AS as output

So, my advice is, "Think UNIX.", which
means: Start with a Stream_LF batch file, and
specify its location with a UNIX-like
syntax. For that matter, if you're
_sending_ any files, thay'd better look
UNIXy, too (Stream_LF or, perhaps,
fixed-512), if you expect them to look like
anything at the other end.
Joseph J. Affrunti
Occasional Visitor

Re: Using SFTP in Batch Mode on OpenVMS


The file was in Stream_LF format but it was the UNIX syntax that did the trick. Thank you very much, Steven. And also you, John, for your reply.
Joseph J. Affrunti
Occasional Visitor

Re: Using SFTP in Batch Mode on OpenVMS

The solution is to use UNIX syntax. Thanks to all who replied.