Jon,

It is not always the case that the record length for a save set will be 8192. That is the default value for save sets written directly to tape. Save sets written directly to disk use 32760 (I think). The value can be specified in the backup command.

I found a script a while ago that sets the proper record length attributes using an undocumented filed in the backup save set header that contains the record length. It uses F$CVUI to convert the unsigned 32 bit field at byte offset 0x28 to the integer record length. You could do something similar to read the actual record length on Linux using od or hexdump. Here's that DCL command procedure.

Larry Baker
US Geological Survey
650-329-5608
[email protected]

$! RESET_BACKUP_SAVESET_ATTRIBUTES.COM
$!
$! P1  is the specification of the BACKUP saveset
$!
$! This procedure resets the record format and record
$! length attributes of a BACKUP saveset -- savesets
$! can get "broken" during certain sorts of file
$! transfers -- such as FTP.  This procedure reads the
$! (undocumented) saveset record attributes directly
$! out of the target file.
$!
$! First render the saveset readable, and implicitly
$! check that the file exists.
$!
$ Set File -
    /Attributes=(RFM:FIX,MRS:512,LRL=512,ORG=SEQ,RAT=NONE) -
    'p1'
$
$ Open/Error=whoops/Read BckSaveset 'p1'
$ Read/Error=whoops/End=whoops BckSaveset Record
$ Close/Nolog BckSaveset
$
$! Find the blocksize from within the record...
$
$ BlockSize = 0
$ BBH_L_BLOCKSIZE = %x28*8
$ BlockSize = F$CVUI(BBH_L_BLOCKSIZE, 32, Record)
$ If BlockSize .lt. 2048 .or. BlockSize .gt. 65535
$ Then
$   Write sys$output "Unexpected block size"
$   Goto whoops
$ Else
$   Set File /Attributes=(RFM:FIX,LRL='BlockSize', -
       MRS='BlockSize',RAT=none) -
       'p1'
$ endif
$ exit
$WHOOPS:
$ Write sys$output "Error"
$ exit

On 6 Apr 2012, at 9:00 AM, [email protected] wrote:

----------------------------------------------------------------------

Message: 1
Date: Thu, 05 Apr 2012 20:03:08 -0500
From: Jon Elson <[email protected]>
To: [email protected]
Subject: [Simh] Reading VMS Backup tapes on Linux
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Well, for those NOT running VMS in simulation, but wanting
to get at some archival programs, I finally figured out how to
make vmsbackup work.  First, you need to extract the backup
save set from the tape container file, so it is just a stream of
bytes, without the block size and file mark information.
In other words, just the bytes from the data blocks, all strung
together.  I already had a program that did this for cr/lf
ASCII files.

Then, the command is :
vmsbackup -xe -b 8192 -f <filename>
where the 8192 is the blocksize of the saveset file on the tape.

Jon




------------------------------

_______________________________________________
Simh mailing list
[email protected]
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to