Operating System - OpenVMS
1751975 Members
4594 Online
108784 Solutions
New Discussion юеВ

Re: Compression of .sav file

 
SOLVED
Go to solution

Compression of .sav file

Dear all,

Trying to compress a *.sav file, I used the GZIP and created a *.sav-gz file. Doing decompress using GZIP тАУd, the *.sav was different from the original one. When trying to recover the backup from this decompresGZIP-product.sav the following messenger appears:

%BACKUP-F-NOTSAVESET, $*.SAV;1 is not a BACKUP save set

Doing a dir/full, I realized that the тАЬRecord formatтАЭ and тАЬRecord attributesтАЭ were different:

Original.sav file
Record format: Fixed length 32256 byte records
Record attributes: None

decompresGZIP-product.sav file
Record format: Stream_LF, maximum 0 bytes, longest 32767 bytes
Record attributes: Carriage return carriage control

What happened?

Regards,

Mia




4 REPLIES 4
John Gillings
Honored Contributor
Solution

Re: Compression of .sav file

Mia,

>What happened?

You lost the OpenVMS file attributes. For normal ZIP there's a "-V" switch (quotes required) to store the attributes in the zip file. You'll have to dig into the GZIP docs to see if there's something similar.

However, all is not lost. The saveset contains enough information to repair the file.

On OpenVMS V8.2 and above use:

$ BACKUP/LIST/REPAIR decompresGZIP-product.sav/SAVE

to restore the correct attributes.

On older versions, use the attached command procedure.

Or, since you know the attributes of the original file you can do it yourself manually:

$ SET FILE/ATTRIBUTES=(RFM:FIX, MRS:32256, LRL:32256) decompresGZIP-product.sav


A crucible of informative mistakes
Steven Schweda
Honored Contributor

Re: Compression of .sav file

> Doing a dir/full, I realized that the
> "Record format" and "Record attributes"
> were different:
> [...]
> What happened?

Apparently, gzip changed the file attributes.
Happens all the time.

alp $ backup VMS_NOTES.TXT; x.bck /save_set
alp $ backup /list x.bck /save_set
alp $ backup /list x.bck /save_set
Listing of save set(s)

Save set: x.bck
Written by: SMS
UIC: [000050,000001]
Date: 28-MAY-2009 16:39:55.68
Command: BACKUP VMS_NOTES.TXT; x.bck/SAVE_SET
Operating system: OpenVMS Alpha version V7.3
BACKUP version: AXP72R001
CPU ID register: 80000000
Node name: _ALP::
Written on: _ALP$DKA0:
Block size: 32256
Group size: 10
Buffer count: 148

[SMS]VMS_NOTES.TXT;5 46 27-FEB-2007 23:17

Total of 1 file, 46 blocks
End of save set

alp $ gzip x.bck
alp $ gzip -d x.bck-gz

alp $ backup /list x.bck /save_set
Listing of save set(s)

%BACKUP-F-NOTSAVESET, ALP$DKA0:[SMS.testb]X.BCK;1 is not a BACKUP save set

There are solutions. For example:

alp $ @ utility:cnvb.com x.bck
File record format is Stream_LF. The file's record format attribute
must be changed to fixed-512 before attempting the actual repair.
Proceed? (y/n [n]): y
Original save set record length was 32256.
Change attributes? (y/n) [n]: y
Setting file attributes...
alp $ backup /list x.bck /save_set
Listing of save set(s)

Save set: x.bck
Written by: SMS
UIC: [000050,000001]
Date: 28-MAY-2009 16:39:55.68
Command: BACKUP VMS_NOTES.TXT; x.bck/SAVE_SET
Operating system: OpenVMS Alpha version V7.3
BACKUP version: AXP72R001
CPU ID register: 80000000
Node name: _ALP::
Written on: _ALP$DKA0:
Block size: 32256
Group size: 10
Buffer count: 148

[SMS]VMS_NOTES.TXT;5 46 27-FEB-2007 23:17

Total of 1 file, 46 blocks
End of save set

alp $


http://antinode.info/dec/sw/fixrec.html


> [...] (quotes required) [...]

Not around here. As it says in the "-h"
help:

alp $ zip3l -h
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage: zip == "$ disk:[dir]zip.exe"
[...]
(Must quote upper-case options, like "-V", unless SET PROC/PARSE=EXTEND)

alp $ zip3l -V

zip error: Invalid command arguments (cannot write zip file to terminal)

alp $ zip3l -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
[...]

alp $ show process /parse_style

28-MAY-2009 16:49:52.26 User: SMS Process ID: 2020A76D
Node: ALP Process name: "SMS"

Soft CPU Affinity: off

Parse Style: Extended
Hein van den Heuvel
Honored Contributor

Re: Compression of .sav file

Mia,

Which OpenVMS version?
For V8.3 or better you may want to compare an external zip with the zlib build-in, but undocumented option.

Try BACKUP / DATA_FORMAT=COMPRESS...
It will avoid having to stage the large
uncompressed save set

For still more on your original problem and some compression caveats see Hoff's notes in:
http://labs.hoffmanlabs.com/node/473

hth,
Hein.
(ps... John, that DCL code looks vaguely familiar :^).

Hoff
Honored Contributor

Re: Compression of .sav file

I'd tend to use zip "-V" here, and specifically with the zip V3 and unzip V6 versions. Not BACKUP. There's little point in zipping most BACKUP savesets (other than BACKUP /IMAGE), it makes dealing with the results more complex (and less portable), and you can end up reducing the efficiency of the file compression in the process.

gzip doesn't preserve the RMS file attributes; the cited article and the OpenVMS FAQ both have some details on avoiding this corruption and ways that can (usually) resolve it.