Operating System - OpenVMS
1751971 Members
4641 Online
108783 Solutions
New Discussion юеВ

Transferring files from OpenVMS to Windows using smbclient

 
SOLVED
Go to solution
James T Horn
Frequent Advisor

Transferring files from OpenVMS to Windows using smbclient

I am trying to transfer an ascii file from OpenVMS 8.3 (with dcl using WRITE) to a windows system using Samba's smbclient.
The file created is a VFC file, and when transferred to the windows box it looks like a binary file in notepad. If I convert the file to stream_lf it looks fine except it is one long record instead of multiple records on openvms.

Can this be done or is there someother way to securely transfer the file?
6 REPLIES 6
Hoff
Honored Contributor

Re: Transferring files from OpenVMS to Windows using smbclient

If you're going to use Microsoft Windows, do consider avoding Notepad. Use Wordpad in its stead. The latter tends to be rather more capable and more tolerant.

As for transfer of files, use of ftp (often via COPY /FTP) or using sftp would be more common choices for file transfer and secure file transfer, respectively. Windows clients have an ftp client but you'd need to add an ftp server if you want to push files. Windows Server does include an ftp server. Windows needs an add-on ssh tool, when last I looked. (I'm using platforms that tend to have this stuff integrated in the distro, so I'm not having to roll my own solution quite as often anymore.)

As for the creation of a compatible file here (and the direct path following your current course), create the file using CREATE /FDL or such (and particularly create the file as stream_lf sequential file) and then use OPEN and WRITE to write the data. It's the default DCL file creation path you're likely using that tends to pick sequential VFC, and it's VFC that stomps sharing on other platforms. Or create an empty Stream LF file somewhere in a local file cache or scratch area, and then replicate it as needed, and OPEN and WRITE to that.

(As for VFC, I won't get into the "fun" that can be UTF-8 and UTF-16 and character encoding.)

As for alternatives, there's always using the web and some DCL CGI and such. Other options include Mercurial and Subversion and rsync and NFS and such, too. There are about three-quarters of a gazillion different ways to do this. Using SMB as a file transfer tool isn't usually my first choice, however.
Steven Schweda
Honored Contributor
Solution

Re: Transferring files from OpenVMS to Windows using smbclient

> If I convert the file to stream_lf [...]

Convert how?

If the Windows program is looking for CR+LF
line endings, then you might try converting
to Stream (RFM:STM) instead of Stream_LF
(RFM:STMLF).
John Gillings
Honored Contributor

Re: Transferring files from OpenVMS to Windows using smbclient

James,

From DCL the sequence:

$ OPEN/WRITE f filespec
$ WRITE f

will create a VFC file - that's the default and there's no global way to change it. If you want to create a file with different attributes use (for example, stream_lf):

$ CREATE/FDL="RECORD;FORMAT STREAM_LF" filespec
$ OPEN/APPEND f filespec
$ WRITE f

The FDL string may contain whatever attributes you like. Take a file in the format you want, do ANALYZE/RMS/FDL and compare it against the same for a file created with OPEN/WRITE to see what's different.

For versions of OpenVMS prior to V8, the /FDL="fdl string" qualifier for CREATE and CONVERT doesn't work. You need to give it an FDL file, or use inline:

$ CREATE/FDL=SYS$INPUT filespec
RECORD
FORMAT STREAM_LF

(maybe the DCL OPEN command should be given a /FDL qualifier?)
A crucible of informative mistakes
Steven Schweda
Honored Contributor

Re: Transferring files from OpenVMS to Windows using smbclient

> (maybe the DCL OPEN command should be
> given a /FDL qualifier?)

I was just doing one of these CREATE /FDL,
OPEN /APPEND things recently, when I had the
same thought. Although, with backward
compatibility in mind, I might never dare to
use it, still it does seem like a nice
feature. Some thought required, of course,
like what to do with an existing file, ...
James T Horn
Frequent Advisor

Re: Transferring files from OpenVMS to Windows using smbclient

I was able to transfer the file and read the file on windows by creating a fdl with: Organization sequential, Carriage_control carriage_return, format stream.

I then created my file normally:
$ open/write test_file test.txt
$ write test_file record
$ close test_file
$ convert/fdl=FDL_FILE.FDL test.txt test.txt

I was then able to transfer the file, and when I looked at the file in WordPad (with "No Wrap"), I was able to see each record one after the other.

Thank you all for all your assistance.
James T Horn
Frequent Advisor

Re: Transferring files from OpenVMS to Windows using smbclient

Already specified solution in post above.