Operating System - OpenVMS
1753784 Members
6918 Online
108799 Solutions
New Discussion юеВ

Re: newbie having issues with sftp to VMS 8.3

 
SOLVED
Go to solution
Steven Schweda
Honored Contributor

Re: newbie having issues with sftp to VMS 8.3

> [...] an HP-UX system [...]

Note that using only a VMS system, you may
not see the same problem. The debug info
shows stuff like:

Ssh2SftpServer/SSHFILEXFERS.C:3484: extended attribute name: rms-rfmt-data@openvms.hp.com alq=0, lrl=0, mrs=0, rfm=var, rat=cr

and the result is another rfm=var file.

Coming from a non-VMS system (like, say,
HP-UX, or even Windows), the TCPIP SFTP
server will (apparently) do STREAM_LF-like
I/O, but that doesn't work well when the file
inherits the non-STREAM_LF attributes of an
existing "Variable length" file (soon to
become ";-1").

Everything's complicated (even without
Microsoft).
Ethan Queen
Occasional Advisor

Re: newbie having issues with sftp to VMS 8.3

O.k., so I did some research and testing and came up with this to go through and convert any file (newest versions only) to STREAM_LF.

The search script that was posted returned any version of the file that was not stream_lf and when I added CONVERT to it, and ran it, it made a new file.

But, because it was searching for any version of the file that was not stream_lf, it would make a new file every time I ran it.

Here is the script:

$! 9 November 2006. SMS.
$! Changes found files to Stream_LF format - 16 May 2010. EQ.
$!
$! Find non-directory files matching P1 which are not
$! Record format: Stream_LF.
$!
$!
$ if (p1 .eqs. "")
$ then
$ p1 = "[...]*.*;*"
$ endif
$!
$ file = f$search(p1)
$ file_old = file
$ file_name = (f$parse(file,,,"NAME")-"^;")
$ file_name_old = file_name
$!
$ loop_top:
$!
$ file = f$search(p1)
$! write sys$output "''FID' ''file'"
$ file_name = (f$parse(file,,,"NAME")-"^;")
$ if (file_name_old .eqs. "") then goto loop_end
$ if (file_name .eqs. file_name_old) then goto loop_top
$!
$ if (.not. f$file_attributes( file_old, "DIRECTORY"))
$ then
$!
$ rfm = f$file_attributes( file_old, "RFM")
$ if (rfm .nes. "STMLF")
$ then
$ write sys$output "''FID' ''file_old'"
$ CONVERT/FDL=STREAM_LF.FDL 'file_name_old' 'file_name_old'
$ endif
$!
$ endif
$ file_old = file
$ file_name_old = file_name
$!
$ goto loop_top
$!
$ loop_end:
$!

And you will also need to make a STREAM_LF.FDL file with this in it:

FILE
ALLOCATION 4
BEST_TRY_CONTIGUOUS yes
EXTENSION 0
ORGANIZATION sequential

RECORD
BLOCK_SPAN yes
FORMAT stream_LF
SIZE 0
Ethan Queen
Occasional Advisor

Re: newbie having issues with sftp to VMS 8.3

Slight bug in the script I posted. This should be fixed to work properly now:

$! 9 November 2006. SMS.
$! Changes found files to Stream_LF format - 16 May 2010. EQ.
$!
$! Find non-directory files matching P1 which are not
$! Record format: Stream_LF.
$!
$!
$ if (p1 .eqs. "")
$ then
$ p1 = "[...]*.*;*"
$ endif
$!
$ file = f$search(p1)
$ file_old = file
$ file_name = f$parse(file,,,"NAME")
$ file_name_old = file_name
$!
$ loop_top:
$!
$ file = f$search(p1)
$! write sys$output "''FID' ''file'"
$ file_name = f$parse(file,,,"NAME")
$ if (file_name_old .eqs. "") then goto loop_end
$ if (file_name .eqs. file_name_old) then goto loop_top
$!
$ if (.not. f$file_attributes( file_old, "DIRECTORY"))
$ then
$!
$ rfm = f$file_attributes( file_old, "RFM")
$ if (rfm .nes. "STMLF")
$ then
$ write sys$output "''FID' ''file_old'"
$ CONVERT/FDL=STREAM_LF.FDL 'file_old' 'file_old'
$ endif
$!
$ endif
$ file_old = file
$ file_name_old = file_name
$!
$ goto loop_top
$!
$ loop_end:
$!