#include <stdio.h>
#include <string.h>
#include <rms.h>

#define RME$C_SETRFM 0x00000001

int sys$open();
int sys$modify();
int sys$close();

void fix512(char *s)
{
   int stat;
   struct FAB myfab = cc$rms_fab;
   myfab.fab$b_fac = FAB$M_PUT;
   myfab.fab$l_fop |= FAB$M_ESC;
   myfab.fab$l_ctx |= RME$C_SETRFM;
   myfab.fab$l_fna = s;
   myfab.fab$b_fns = strlen(s);
   stat = sys$open(&myfab,0,0);
   printf("stat=%d\n",stat);
   myfab.fab$b_rfm = FAB$C_FIX;
   myfab.fab$w_mrs = 512;
   stat = sys$modify(&myfab,0,0);
   printf("stat=%d\n",stat);
   stat = sys$close(&myfab,0,0);
   printf("stat=%d\n",stat);
   return;
}

main()
{
   fix512("z.z");
}
