Article 169972 of comp.os.vms:

>:  The issue is that backup savesets have a record size other than 512
>: which ftp treats as the default record size. You need to use put/fdl and

Here is a little proggie to reset the file characteristics to the appropriate
values for a suspected mangled backup saveset using the record size stored
in the file. It is an alternative to $SET FILE/ATTR and shows how to use
a little know (undocumented, unsupported, but practical :-) RMS function.

/* FIX_SAVESET.C, Hein van den Heuvel, Digital, April 1995
** fix RMS file attributes for (FTP transferred :^) BACKUP savesets */
/* #define RME$C_SETRFM 0x00000001 */
#include <rmedef>
#include <stdio>
#include <file>
#include <rms>
#define block_size_offset 10
main(int argc, char *argv[])
{
int buf[512/4], status;
struct FAB fab = cc$rms_fab;
struct RAB rab = cc$rms_rab;

    if (argc < 2) return 16;
    fab.fab$b_fac = FAB$M_PUT | FAB$M_BIO;
    fab.fab$l_fna = argv[1];
    fab.fab$b_fns = strlen(fab.fab$l_fna);
    rab.rab$l_fab = &fab;
    rab.rab$l_ubf = buf;
    rab.rab$w_usz = sizeof buf;
    status = SYS$OPEN(&fab);
    if (status & 1) status = SYS$CONNECT(&rab);
    if (status & 1) status = SYS$READ(&rab);
    if (!(status & 1)) return status;
    printf("Setting blocksize to: %d",buf[block_size_offset]);
    fab.fab$l_fop = FAB$M_ESC;
    fab.fab$l_ctx = RME$C_SETRFM;
    fab.fab$b_org = FAB$C_SEQ;
    fab.fab$b_rfm = FAB$C_FIX;
    fab.fab$w_mrs = buf[block_size_offset];
    status = SYS$MODIFY(&fab);
    if (status & 1) SYS$CLOSE(&fab);
    return status;
}


Hope this helps,                +--------------------------------------+
Hein van den Heuvel, Digital.   | All opinions expressed are mine, and |
  "Makers of VMS and other      | may not reflect those of my employer |
   fine Operating Systems."     +--------------------------------------+


