<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change/Modify VMS file creation date in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177641#M1064</link>
    <description>re: using the XABDAT to modify the attribute.&lt;BR /&gt;&lt;BR /&gt;That shouldn't work. The RMS reference manual&lt;BR /&gt;(V7.3-2) states that the close service only&lt;BR /&gt;processes XABPRO and XABRDT XABs.&lt;BR /&gt;&lt;BR /&gt;I tried Hein's program on a V7.3-1 system and&lt;BR /&gt;it appears not to work. So I guess this is&lt;BR /&gt;something that changed, or was fixed, on &lt;BR /&gt;some version of OpenVMS.&lt;BR /&gt;&lt;BR /&gt;Martin Kirby</description>
    <pubDate>Fri, 30 Jan 2004 05:06:01 GMT</pubDate>
    <dc:creator>Martin Kirby</dc:creator>
    <dc:date>2004-01-30T05:06:01Z</dc:date>
    <item>
      <title>Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177630#M1053</link>
      <description>Is it possible to change a file creation date using tools native to VMS? The only reference I've seen is to an old FILE utility from Joe Meadows.&lt;BR /&gt;&lt;BR /&gt;I didn't see anything that looked like it would do it from set file.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 29 Jan 2004 10:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177630#M1053</guid>
      <dc:creator>Kyle Snavely_1</dc:creator>
      <dc:date>2004-01-29T10:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177631#M1054</link>
      <description>Use DFU SET FILE/CREATION_DATE command&lt;BR /&gt;DFU can be obtained from&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/freeware/freeware60/dfu/" target="_blank"&gt;http://h71000.www7.hp.com/freeware/freeware60/dfu/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;or an old version from&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/freeware/freeware50/dfu027a/" target="_blank"&gt;http://h71000.www7.hp.com/freeware/freeware50/dfu027a/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;why do you want to do this?</description>
      <pubDate>Thu, 29 Jan 2004 11:12:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177631#M1054</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2004-01-29T11:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177632#M1055</link>
      <description>We have a bunch of file creation scripts that were supposed to run yesterday but ran today. So I want to modify the date from today to yesterday so we don't have any problems when the scripts run tonight since it concatenates files using copy/since=today</description>
      <pubDate>Thu, 29 Jan 2004 11:28:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177632#M1055</guid>
      <dc:creator>Kyle Snavely_1</dc:creator>
      <dc:date>2004-01-29T11:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177633#M1056</link>
      <description>If you don't have the tools, you can simply do "copy x.x ;". This will re-create the file. Cleanup the previous version afterwards.</description>
      <pubDate>Thu, 29 Jan 2004 11:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177633#M1056</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2004-01-29T11:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177634#M1057</link>
      <description>Hello Kyle,&lt;BR /&gt;perahps you need COPY/SINCE=&lt;TODAY&gt;/MODIF&lt;BR /&gt;The /MODIF operator tell to VMS check modify date instead default created date.&lt;BR /&gt; &lt;BR /&gt;Bye&lt;BR /&gt;Antoniov&lt;BR /&gt;&lt;/TODAY&gt;</description>
      <pubDate>Thu, 29 Jan 2004 11:33:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177634#M1057</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2004-01-29T11:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177635#M1058</link>
      <description>To make sure that the application behavious correctly, rename the new version to ;-1. You never now what the application is doing with the version number.</description>
      <pubDate>Thu, 29 Jan 2004 11:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177635#M1058</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2004-01-29T11:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177636#M1059</link>
      <description>The only "correct" way I know of is to write (or buy) something that opens the file with an attached XAB so you can stuff a new date into the creation date slot of the appropriate field.  The SET FILE /ATTRIBUTE option does not accept the CDT option.&lt;BR /&gt;&lt;BR /&gt;Now, if you are REALLY REALLY GUTSY it is possible to cheat like heck by opening the index file with DCL, finding the file header, locating and updating the file date info, and recomputing the checksum for that header, then write back the block.  But that is only for true masochists.  &lt;BR /&gt;&lt;BR /&gt;I do NOT suggest that you take it to that extreme.  I have done it once in a true emergency and hope to never again need to do this.  You would do better to write yourself a little utility program in BASIC, FORTRAN, or something else convenient to your site, make it use a logical name for the file name and another one for the desired date, and then just stuff the date in the XAB for the file you selected.  Then you could write a little DCL script to drive it through the files you wanted to update.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2004 11:39:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177636#M1059</guid>
      <dc:creator>Richard W Hunt</dc:creator>
      <dc:date>2004-01-29T11:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177637#M1060</link>
      <description>to change the date from today to yesterday you need a program that will change the file header. DFU SET FILE/CREATE will do this.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2004 11:43:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177637#M1060</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2004-01-29T11:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177638#M1061</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;since you already mention FILE I do recommend it once more. It is the Swiss army knife for file attributes, easy to use and I never ever had a problem with it. &lt;BR /&gt;&lt;BR /&gt;File can be found at &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://vms.process.com/scripts/fileserv/fileserv_search.exe?package=file&amp;amp;description=&amp;amp;author=meadows&amp;amp;system=Either&amp;amp;language=All" target="_blank"&gt;http://vms.process.com/scripts/fileserv/fileserv_search.exe?package=file&amp;amp;description=&amp;amp;author=meadows&amp;amp;system=Either&amp;amp;language=All&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin</description>
      <pubDate>Thu, 29 Jan 2004 13:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177638#M1061</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2004-01-29T13:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177639#M1062</link>
      <description>As Ian repeatedly said... DFU is your tool :-)&lt;BR /&gt;&lt;BR /&gt;If somehow you can not get that going rightaway, and you have this problem to deal with, then you could consider the little program I wrote a while back. It displays the current CDT and sets to the provided argument. I'll include it below as well as attach it as text file.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;#include descrip&lt;BR /&gt;#include stdio&lt;BR /&gt;#include RMS&lt;BR /&gt;main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;    struct FAB fab = cc$rms_fab;&lt;BR /&gt;    struct XABDAT dat = cc$rms_xabdat;&lt;BR /&gt;    int stat;&lt;BR /&gt;    char   ascii_date[24];&lt;BR /&gt;    $DESCRIPTOR (date_dx, ascii_date);&lt;BR /&gt;    if (argc &amp;lt; 3) return 24;&lt;BR /&gt;    fab.fab$l_fna = argv[1];&lt;BR /&gt;    fab.fab$b_fns = strlen(fab.fab$l_fna);&lt;BR /&gt;    fab.fab$b_shr = FAB$M_UPI;&lt;BR /&gt;    fab.fab$b_fac = FAB$M_PUT;&lt;BR /&gt;    fab.fab$l_xab = &amp;amp;dat;&lt;BR /&gt;    stat = SYS$OPEN ( &amp;amp;fab );&lt;BR /&gt;    if (stat &amp;amp; 1)&lt;BR /&gt;        {&lt;BR /&gt;        stat = SYS$ASCTIM ( 0, &amp;amp;date_dx, &amp;amp;dat.xab$q_cdt, 0);&lt;BR /&gt;        ascii_date[23]=0;&lt;BR /&gt;        printf ("Creation date = %s\n", ascii_date);&lt;BR /&gt;        date_dx.dsc$a_pointer = argv[2];&lt;BR /&gt;        date_dx.dsc$w_length = strlen (date_dx.dsc$a_pointer);&lt;BR /&gt;        stat = SYS$BINTIM (&amp;amp;date_dx, &amp;amp;dat.xab$q_cdt);&lt;BR /&gt;        stat = SYS$CLOSE ( &amp;amp;fab );&lt;BR /&gt;        }&lt;BR /&gt;    return stat;&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2004 16:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177639#M1062</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-01-29T16:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177640#M1063</link>
      <description>You can simply change your system time &amp;amp; date that you want.  Once you're done with and have what you need, then change the clock back.</description>
      <pubDate>Thu, 29 Jan 2004 20:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177640#M1063</guid>
      <dc:creator>Ian Derringer</dc:creator>
      <dc:date>2004-01-29T20:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177641#M1064</link>
      <description>re: using the XABDAT to modify the attribute.&lt;BR /&gt;&lt;BR /&gt;That shouldn't work. The RMS reference manual&lt;BR /&gt;(V7.3-2) states that the close service only&lt;BR /&gt;processes XABPRO and XABRDT XABs.&lt;BR /&gt;&lt;BR /&gt;I tried Hein's program on a V7.3-1 system and&lt;BR /&gt;it appears not to work. So I guess this is&lt;BR /&gt;something that changed, or was fixed, on &lt;BR /&gt;some version of OpenVMS.&lt;BR /&gt;&lt;BR /&gt;Martin Kirby</description>
      <pubDate>Fri, 30 Jan 2004 05:06:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177641#M1064</guid>
      <dc:creator>Martin Kirby</dc:creator>
      <dc:date>2004-01-30T05:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177642#M1065</link>
      <description>Note that certain invocations of the CRTL's utime will set the CDT in recent versions and on ODS-5 disks.&lt;BR /&gt;&lt;BR /&gt;For some reason I can't get Hein's example to work; all the file's dates remain the same after running it, and I even stepped through it in the debugger to make sure the return values that aren't being checked were successful.&lt;BR /&gt;&lt;BR /&gt;I"ve attached and included an example with the same interface as Hein's but with a completely different approach, based on the work of other people as the comments indicate.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----- zapcdt.c -----&lt;BR /&gt;#include &lt;ATRDEF.H&gt;&lt;BR /&gt;#include &lt;CLIMSGDEF.H&gt;&lt;BR /&gt;#include &lt;DESCRIP.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;#include &lt;FIBDEF.H&gt;&lt;BR /&gt;#include &lt;LIBDEF.H&gt;&lt;BR /&gt;#include &lt;LIB&gt;&lt;BR /&gt;#include &lt;IODEF.H&gt;&lt;BR /&gt;#include &lt;RMS.H&gt;&lt;BR /&gt;#include &lt;SSDEF.H&gt;&lt;BR /&gt;#include &lt;STARLET.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;struct vmsdate {&lt;BR /&gt;        long int low;&lt;BR /&gt;        long int high;&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;extern int main(int, char **);&lt;BR /&gt;int set_cdt(char *, struct vmsdate *);&lt;BR /&gt;&lt;BR /&gt;int main(argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;    static char date_string[NAM$C_MAXRSS+1];&lt;BR /&gt;    $DESCRIPTOR(date_string_dsc, date_string);&lt;BR /&gt;    struct vmsdate bintime;&lt;BR /&gt;    unsigned int retsts;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * If there aren't any parameters, tell the user how it's done and&lt;BR /&gt; * exit.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;    if (argc &amp;lt; 2) {&lt;BR /&gt;        fprintf(stderr, "Usage: %s filespec [vms_date_time]\n", argv[0]);&lt;BR /&gt;        exit(CLI$_NULFIL);&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * If there is a second parameter, assume it is a VMS date/time string and&lt;BR /&gt; * parse it into a 64-bit binary date/time.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;    if (argc &amp;gt; 2) {&lt;BR /&gt;        strncpy(date_string, argv[2], sizeof(date_string));&lt;BR /&gt;        date_string_dsc.dsc$w_length = strlen(date_string);&lt;BR /&gt;        retsts = sys$bintim(&amp;amp;date_string_dsc, &amp;amp;bintime);&lt;BR /&gt;        if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;            exit(retsts);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        retsts = set_cdt( argv[1], &amp;amp;bintime );&lt;BR /&gt;    }&lt;BR /&gt;    else {&lt;BR /&gt;        retsts = set_cdt( argv[1], NULL );  /* let it fill in current time */&lt;BR /&gt;    }&lt;BR /&gt;    exit(retsts);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* set_cdt -- set the creation time and the revision time of a file&lt;BR /&gt; * This is based on Charles Bailey's my_utime from the Perl 5 distribution,&lt;BR /&gt; * except it changes the creation time as well as the revision time and has&lt;BR /&gt; * simpler error handling (no exception handlers).&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;/* from the original comments in Perl's VMS.C: */&lt;BR /&gt;/* my_utime - update modification time of a file&lt;BR /&gt; * Code here is based on Joe Meadows' FILE utility.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;int set_cdt(char *file, struct vmsdate *date_time)&lt;BR /&gt;{&lt;BR /&gt;  register int i;&lt;BR /&gt;  static struct vmsdate bintime;&lt;BR /&gt;  unsigned long int chan, retsts;&lt;BR /&gt;  struct io_stat_blk {                      /*  I/O status block */&lt;BR /&gt;    short int completion_status;&lt;BR /&gt;    short int msg_len;&lt;BR /&gt;    int device_specific_info;&lt;BR /&gt;  } iosb;&lt;BR /&gt;  char vmsspec[NAM$C_MAXRSS+1], rsa[NAM$C_MAXRSS], esa[NAM$C_MAXRSS];&lt;BR /&gt;  struct FAB myfab = cc$rms_fab;&lt;BR /&gt;  struct NAM mynam = cc$rms_nam;&lt;BR /&gt;#if defined (__DECC) &amp;amp;&amp;amp; defined (__VAX)&lt;BR /&gt;  /* VAX DEC C atrdef.h has unsigned type for pointer member atr$l_addr,&lt;BR /&gt;   * at least through VMS V6.1, which causes a type-conversion warning.&lt;BR /&gt;   */&lt;BR /&gt;#  pragma message save&lt;BR /&gt;#  pragma message disable cvtdiftypes&lt;BR /&gt;#endif&lt;BR /&gt;  struct atrdef myatr[3] = {{sizeof bintime, ATR$C_CREDATE, &amp;amp;bintime},&lt;BR /&gt;                            {sizeof bintime, ATR$C_REVDATE, &amp;amp;bintime},&lt;BR /&gt;                            {0,0,0}};&lt;BR /&gt;  static struct fibdef myfib;&lt;BR /&gt;#if defined (__DECC) &amp;amp;&amp;amp; defined (__VAX)&lt;BR /&gt;  /* This should be right after the declaration of myatr, but due&lt;BR /&gt;   * to a bug in VAX DEC C, this takes effect a statement early.&lt;BR /&gt;   */&lt;BR /&gt;#  pragma message restore&lt;BR /&gt;#endif&lt;BR /&gt;  struct dsc$descriptor fibdsc = {sizeof(myfib), DSC$K_DTYPE_Z, DSC$K_CLASS_S,(char *) &amp;amp;myfib},&lt;BR /&gt;                        devdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0},&lt;BR /&gt;                        fnmdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};&lt;BR /&gt;&lt;BR /&gt;  if (file == NULL || *file == '\0') {&lt;BR /&gt;    return LIB$_INVARG;&lt;BR /&gt;  }&lt;BR /&gt;  strncpy(vmsspec, file, sizeof(vmsspec));&lt;BR /&gt;&lt;BR /&gt;  if (date_time != NULL) {&lt;BR /&gt;    bintime.low = date_time-&amp;gt;low;&lt;BR /&gt;    bintime.high = date_time-&amp;gt;high;&lt;BR /&gt;  }&lt;BR /&gt;  else {&lt;BR /&gt;    /* Just get the current time in VMS format directly */&lt;BR /&gt;    retsts = sys$gettim(&amp;amp;bintime);&lt;BR /&gt;    if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;      return retsts;&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  myfab.fab$l_fna = vmsspec;&lt;BR /&gt;  myfab.fab$b_fns = (unsigned char) strlen(vmsspec);&lt;BR /&gt;  myfab.fab$l_nam = &amp;amp;mynam;&lt;BR /&gt;  mynam.nam$l_esa = esa;&lt;BR /&gt;  mynam.nam$b_ess = (unsigned char) sizeof esa;&lt;BR /&gt;  mynam.nam$l_rsa = rsa;&lt;BR /&gt;  mynam.nam$b_rss = (unsigned char) sizeof rsa;&lt;BR /&gt;&lt;BR /&gt;  /* Look for the file to be affected, letting RMS parse the file&lt;BR /&gt;   * specification for us as well.&lt;BR /&gt;   */&lt;BR /&gt;  retsts = sys$parse(&amp;amp;myfab,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;  retsts = sys$search(&amp;amp;myfab,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  devdsc.dsc$w_length = mynam.nam$b_dev;&lt;BR /&gt;  devdsc.dsc$a_pointer = (char *) mynam.nam$l_dev;&lt;BR /&gt;&lt;BR /&gt;  retsts = sys$assign(&amp;amp;devdsc,&amp;amp;chan,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  fnmdsc.dsc$a_pointer = mynam.nam$l_name;&lt;BR /&gt;  fnmdsc.dsc$w_length = mynam.nam$b_name + mynam.nam$b_type + mynam.nam$b_ver;&lt;BR /&gt;&lt;BR /&gt;  memset((void *) &amp;amp;myfib, 0, sizeof myfib);&lt;BR /&gt;#ifdef __DECC&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$w_fid[i] = mynam.nam$w_fid[i];&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$w_did[i] = mynam.nam$w_did[i];&lt;BR /&gt;  /* This prevents the revision time of the file being reset to the current&lt;BR /&gt;   * time as a result of our IO$_MODIFY $QIO. */&lt;BR /&gt;  myfib.fib$l_acctl = FIB$M_NORECORD;&lt;BR /&gt;#else&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$r_fid_overlay.fib$w_fid[i] = mynam.nam$w_fid[i];&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$r_did_overlay.fib$w_did[i] = mynam.nam$w_did[i];&lt;BR /&gt;  myfib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;&lt;BR /&gt;#endif&lt;BR /&gt;  retsts = sys$qiow(0,chan,IO$_MODIFY,&amp;amp;iosb,0,0,&amp;amp;fibdsc,&amp;amp;fnmdsc,0,0,myatr,0);&lt;BR /&gt;  if (retsts &amp;amp; 1) retsts = iosb.completion_status;&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  return SS$_NORMAL;&lt;BR /&gt;}  /* end of set_cdt() */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;ATRDEF.H&gt;&lt;BR /&gt;#include &lt;CLIMSGDEF.H&gt;&lt;BR /&gt;#include &lt;DESCRIP.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;#include &lt;FIBDEF.H&gt;&lt;BR /&gt;#include &lt;LIBDEF.H&gt;&lt;BR /&gt;#include &lt;LIB&gt;&lt;BR /&gt;#include &lt;IODEF.H&gt;&lt;BR /&gt;#include &lt;RMS.H&gt;&lt;BR /&gt;#include &lt;SSDEF.H&gt;&lt;BR /&gt;#include &lt;STARLET.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;struct vmsdate {&lt;BR /&gt; long int low;&lt;BR /&gt; long int high;&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;extern int main(int, char **);&lt;BR /&gt;int set_cdt(char *, struct vmsdate *);&lt;BR /&gt;&lt;BR /&gt;int main(argc, argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;    static char date_string[NAM$C_MAXRSS+1];&lt;BR /&gt;    $DESCRIPTOR(date_string_dsc, date_string);&lt;BR /&gt;    struct vmsdate bintime;&lt;BR /&gt;    unsigned int retsts;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * If there aren't any parameters, tell the user how it's done and&lt;BR /&gt; * exit.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;    if (argc &amp;lt; 2) {&lt;BR /&gt; fprintf(stderr, "Usage: %s filespec [vms_date_time]\n", argv[0]);&lt;BR /&gt; exit(CLI$_NULFIL);        &lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;/* &lt;BR /&gt; * If there is a second parameter, assume it is a VMS date/time string and &lt;BR /&gt; * parse it into a 64-bit binary date/time.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;    if (argc &amp;gt; 2) {&lt;BR /&gt;     strncpy(date_string, argv[2], sizeof(date_string));&lt;BR /&gt; date_string_dsc.dsc$w_length = strlen(date_string);&lt;BR /&gt; retsts = sys$bintim(&amp;amp;date_string_dsc, &amp;amp;bintime);&lt;BR /&gt;   if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;     exit(retsts);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; retsts = set_cdt( argv[1], &amp;amp;bintime );&lt;BR /&gt;    }&lt;BR /&gt;    else {&lt;BR /&gt; retsts = set_cdt( argv[1], NULL );  /* let it fill in current time */&lt;BR /&gt;    }&lt;BR /&gt;    exit(retsts);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* set_cdt -- set the creation time and the revision time of a file&lt;BR /&gt; * This is based on Charles Bailey's my_utime from the Perl 5 distribution,&lt;BR /&gt; * except it changes the creation time as well as the revision time and has&lt;BR /&gt; * simpler error handling (no exception handlers).&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;/* from the original comments in Perl's VMS.C: */&lt;BR /&gt;/* my_utime - update modification time of a file&lt;BR /&gt; * Code here is based on Joe Meadows' FILE utility.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;int set_cdt(char *file, struct vmsdate *date_time)&lt;BR /&gt;{&lt;BR /&gt;  register int i;&lt;BR /&gt;  static struct vmsdate bintime;&lt;BR /&gt;  unsigned long int chan, retsts;&lt;BR /&gt;  struct io_stat_blk {                      /*  I/O status block */&lt;BR /&gt;    short int completion_status;&lt;BR /&gt;    short int msg_len;&lt;BR /&gt;    int device_specific_info;&lt;BR /&gt;  } iosb;&lt;BR /&gt;  char vmsspec[NAM$C_MAXRSS+1], rsa[NAM$C_MAXRSS], esa[NAM$C_MAXRSS];&lt;BR /&gt;  struct FAB myfab = cc$rms_fab;&lt;BR /&gt;  struct NAM mynam = cc$rms_nam;&lt;BR /&gt;#if defined (__DECC) &amp;amp;&amp;amp; defined (__VAX)&lt;BR /&gt;  /* VAX DEC C atrdef.h has unsigned type for pointer member atr$l_addr,&lt;BR /&gt;   * at least through VMS V6.1, which causes a type-conversion warning.&lt;BR /&gt;   */&lt;BR /&gt;#  pragma message save&lt;BR /&gt;#  pragma message disable cvtdiftypes&lt;BR /&gt;#endif&lt;BR /&gt;  struct atrdef myatr[3] = {{sizeof bintime, ATR$C_CREDATE, &amp;amp;bintime}, &lt;BR /&gt;       {sizeof bintime, ATR$C_REVDATE, &amp;amp;bintime}, &lt;BR /&gt;       {0,0,0}};&lt;BR /&gt;  static struct fibdef myfib;&lt;BR /&gt;#if defined (__DECC) &amp;amp;&amp;amp; defined (__VAX)&lt;BR /&gt;  /* This should be right after the declaration of myatr, but due&lt;BR /&gt;   * to a bug in VAX DEC C, this takes effect a statement early.&lt;BR /&gt;   */&lt;BR /&gt;#  pragma message restore&lt;BR /&gt;#endif&lt;BR /&gt;  struct dsc$descriptor fibdsc = {sizeof(myfib), DSC$K_DTYPE_Z, DSC$K_CLASS_S,(char *) &amp;amp;myfib},&lt;BR /&gt;                        devdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0},&lt;BR /&gt;                        fnmdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};&lt;BR /&gt;&lt;BR /&gt;  if (file == NULL || *file == '\0') {&lt;BR /&gt;    return LIB$_INVARG;&lt;BR /&gt;  }&lt;BR /&gt;  strncpy(vmsspec, file, sizeof(vmsspec));&lt;BR /&gt;&lt;BR /&gt;  if (date_time != NULL) {&lt;BR /&gt;    bintime.low = date_time-&amp;gt;low;&lt;BR /&gt;    bintime.high = date_time-&amp;gt;high;&lt;BR /&gt;  }&lt;BR /&gt;  else {&lt;BR /&gt;    /* Just get the current time in VMS format directly */&lt;BR /&gt;    retsts = sys$gettim(&amp;amp;bintime);&lt;BR /&gt;    if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;      return retsts;&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  myfab.fab$l_fna = vmsspec;&lt;BR /&gt;  myfab.fab$b_fns = (unsigned char) strlen(vmsspec);&lt;BR /&gt;  myfab.fab$l_nam = &amp;amp;mynam;&lt;BR /&gt;  mynam.nam$l_esa = esa;&lt;BR /&gt;  mynam.nam$b_ess = (unsigned char) sizeof esa;&lt;BR /&gt;  mynam.nam$l_rsa = rsa;&lt;BR /&gt;  mynam.nam$b_rss = (unsigned char) sizeof rsa;&lt;BR /&gt;&lt;BR /&gt;  /* Look for the file to be affected, letting RMS parse the file&lt;BR /&gt;   * specification for us as well.  &lt;BR /&gt;   */&lt;BR /&gt;  retsts = sys$parse(&amp;amp;myfab,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;  retsts = sys$search(&amp;amp;myfab,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  devdsc.dsc$w_length = mynam.nam$b_dev;&lt;BR /&gt;  devdsc.dsc$a_pointer = (char *) mynam.nam$l_dev;&lt;BR /&gt;&lt;BR /&gt;  retsts = sys$assign(&amp;amp;devdsc,&amp;amp;chan,0,0);&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  fnmdsc.dsc$a_pointer = mynam.nam$l_name;&lt;BR /&gt;  fnmdsc.dsc$w_length = mynam.nam$b_name + mynam.nam$b_type + mynam.nam$b_ver;&lt;BR /&gt;&lt;BR /&gt;  memset((void *) &amp;amp;myfib, 0, sizeof myfib);&lt;BR /&gt;#ifdef __DECC&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$w_fid[i] = mynam.nam$w_fid[i];&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$w_did[i] = mynam.nam$w_did[i];&lt;BR /&gt;  /* This prevents the revision time of the file being reset to the current&lt;BR /&gt;   * time as a result of our IO$_MODIFY $QIO. */&lt;BR /&gt;  myfib.fib$l_acctl = FIB$M_NORECORD;&lt;BR /&gt;#else&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$r_fid_overlay.fib$w_fid[i] = mynam.nam$w_fid[i];&lt;BR /&gt;  for (i=0;i&amp;lt;3;i++) myfib.fib$r_did_overlay.fib$w_did[i] = mynam.nam$w_did[i];&lt;BR /&gt;  myfib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;&lt;BR /&gt;#endif&lt;BR /&gt;  retsts = sys$qiow(0,chan,IO$_MODIFY,&amp;amp;iosb,0,0,&amp;amp;fibdsc,&amp;amp;fnmdsc,0,0,myatr,0);&lt;BR /&gt;  if (retsts &amp;amp; 1) retsts = iosb.completion_status;&lt;BR /&gt;  if (!(retsts &amp;amp; 1)) {&lt;BR /&gt;    return retsts;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  return SS$_NORMAL;&lt;BR /&gt;}  /* end of set_cdt() */&lt;BR /&gt;----- zapcdt.c -----&lt;BR /&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;&lt;/STARLET.H&gt;&lt;/SSDEF.H&gt;&lt;/RMS.H&gt;&lt;/IODEF.H&gt;&lt;/LIB&gt;&lt;/LIBDEF.H&gt;&lt;/FIBDEF.H&gt;&lt;/ERRNO.H&gt;&lt;/DESCRIP.H&gt;&lt;/CLIMSGDEF.H&gt;&lt;/ATRDEF.H&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;&lt;/STARLET.H&gt;&lt;/SSDEF.H&gt;&lt;/RMS.H&gt;&lt;/IODEF.H&gt;&lt;/LIB&gt;&lt;/LIBDEF.H&gt;&lt;/FIBDEF.H&gt;&lt;/ERRNO.H&gt;&lt;/DESCRIP.H&gt;&lt;/CLIMSGDEF.H&gt;&lt;/ATRDEF.H&gt;</description>
      <pubDate>Fri, 30 Jan 2004 07:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177642#M1065</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2004-01-30T07:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177643#M1066</link>
      <description>I'm sorry folks. I just found that program from 1999 in my 'examples' directory and assumed it worked. I don't recall whether it was just a test of am adaption on an 'rdt' program. (and it is also ugly in its lack of proper funciton definition). $CLOSE should indeed only take inputs for XABPRO and XABRDT&lt;BR /&gt;&lt;BR /&gt;Oh well...&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2004 09:25:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177643#M1066</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-01-30T09:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177644#M1067</link>
      <description>Digging into the past, just for grins...&lt;BR /&gt;&lt;BR /&gt;I couldn't help but wonder why I had this broken example. So I hit an altavista search engine over some (hp internal) notesfiles (vms-es old and improved version of forums :-). It popped up:&lt;BR /&gt;&lt;BR /&gt;10 WIZARD 3223.1 (0.14) Author: HEIN@MIASYS&lt;BR /&gt;Date: 18-Oct-1999 14:44:03&lt;BR /&gt; You can use the XAB$Q_RDT field in the XABRDT as input to a $CLOSE to change the REVISION date for a write accessed file to a user ... &lt;BR /&gt;&lt;BR /&gt;$DIR/DATE [.EXAMPLES]*DT.C&lt;BR /&gt;$ $DIR/DATE [.EXAMPLES]*DT.C&lt;BR /&gt;&lt;BR /&gt;CDT.C;4  18-OCT-1999 14:04:25.00&lt;BR /&gt;RDT.C;3  21-JUL-1994 00:37:18.00&lt;BR /&gt;&lt;BR /&gt;Ah So! Look at the date for the file and for the reply! I must have made it to support a Wizard question:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/wizard/wiz_3223.html" target="_blank"&gt;http://h71000.www7.hp.com/wizard/wiz_3223.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Which begs the question... is there any question left that wasn't asked and answered before :-). The tricky part is to find them!&lt;BR /&gt;&lt;BR /&gt;(as bonus for reading these ramblings i'll include that rdt.c ;-).&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;#include descrip&lt;BR /&gt;#include stdio&lt;BR /&gt;#include RMS&lt;BR /&gt;main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;    struct FAB fab = cc$rms_fab;&lt;BR /&gt;    struct XABRDT dat = cc$rms_xabrdt;&lt;BR /&gt;    int stat;&lt;BR /&gt;    int date_dx[2];&lt;BR /&gt;&lt;BR /&gt;    if (argc &amp;lt; 3) {&lt;BR /&gt;        printf ("Usage: %s &lt;FILE-NAME&gt; &lt;REVISION-DATE&gt;\n", argv[0]);&lt;BR /&gt;        return 1;&lt;BR /&gt;        }&lt;BR /&gt;    date_dx[0] = strlen (argv[2]);&lt;BR /&gt;    date_dx[1] = (int) argv[2];&lt;BR /&gt;    fab.fab$l_fna = argv[1];&lt;BR /&gt;    fab.fab$b_fns = strlen(fab.fab$l_fna);&lt;BR /&gt;    fab.fab$b_fac = FAB$M_PUT;&lt;BR /&gt;    fab.fab$l_xab = &amp;amp;dat;&lt;BR /&gt;&lt;BR /&gt;    stat = sys$open ( &amp;amp;fab );&lt;BR /&gt;    if (stat &amp;amp; 1) stat = sys$bintim ( date_dx, &amp;amp;dat.xab$q_rdt);&lt;BR /&gt;    if (stat &amp;amp; 1) stat = sys$close ( &amp;amp;fab );&lt;BR /&gt;    return stat;&lt;BR /&gt;}&lt;BR /&gt;&lt;/REVISION-DATE&gt;&lt;/FILE-NAME&gt;</description>
      <pubDate>Fri, 30 Jan 2004 10:12:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177644#M1067</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-01-30T10:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177645#M1068</link>
      <description>You can use ANAL/RMS/FDL=fdl-file to create an FDL file of the target, edit the FDL file to give it a different creation date, then CONVERT/FDL=edited-fdl-file.&lt;BR /&gt;&lt;BR /&gt;I know this worked several versions of VMS ago, assume it still does...&lt;BR /&gt;&lt;BR /&gt;PJ</description>
      <pubDate>Mon, 23 Feb 2004 15:45:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177645#M1068</guid>
      <dc:creator>Paul Jerrom</dc:creator>
      <dc:date>2004-02-23T15:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177646#M1069</link>
      <description>Hi !&lt;BR /&gt; Just my 2 cents:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://starlet.deltatel.ru/~laishev/work/cdate.c" target="_blank"&gt;http://starlet.deltatel.ru/~laishev/work/cdate.c&lt;/A&gt;</description>
      <pubDate>Tue, 02 Mar 2004 09:37:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177646#M1069</guid>
      <dc:creator>Ruslan R. Laishev</dc:creator>
      <dc:date>2004-03-02T09:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177647#M1070</link>
      <description>Can you, please, put up your source code as attachments next time? That would preserve the indendation I think and make things a bit easier to understand. Thanks!</description>
      <pubDate>Tue, 02 Mar 2004 11:59:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177647#M1070</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2004-03-02T11:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177648#M1071</link>
      <description>Sorry.&lt;BR /&gt;Sure.&lt;BR /&gt;Thanks for remind.</description>
      <pubDate>Tue, 02 Mar 2004 13:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177648#M1071</guid>
      <dc:creator>Ruslan R. Laishev</dc:creator>
      <dc:date>2004-03-02T13:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change/Modify VMS file creation date</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177649#M1072</link>
      <description>Hello, Ruslan.&lt;BR /&gt;The comment wasn't directed at you - as far as I can tell you posted an URL, not source code into the text entry box.</description>
      <pubDate>Tue, 02 Mar 2004 14:07:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/change-modify-vms-file-creation-date/m-p/3177649#M1072</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2004-03-02T14:07:07Z</dc:date>
    </item>
  </channel>
</rss>

