<?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: DCOB$ACC_DATE in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971464#M82814</link>
    <description>The code below works for me.&lt;BR /&gt;It assumes and verifies presence of a logical name with the selected 6 byte date value.&lt;BR /&gt;&lt;BR /&gt;Of course the default link will cause a 'multiple defined symbol'. A serious implemenation would take care of that and provide of all of:&lt;BR /&gt;&lt;BR /&gt;cob_acc_date      DDMMYY &lt;BR /&gt;cob_acc_time      HHMMSSNN&lt;BR /&gt;cob_acc_day       YYDDD&lt;BR /&gt;cob_acc_day_week  day of week 1-7&lt;BR /&gt;cob_acc_date_yyyy DDMMYYYY &lt;BR /&gt;cob_acc_day_yyyy  YYYYDDD&lt;BR /&gt;&lt;BR /&gt;But that would be like work!&lt;BR /&gt;(Which I'll gladly undertake for a fee. Send Email!).&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ type date.cob&lt;BR /&gt;&lt;BR /&gt;IDENTIFICATION DIVISION.&lt;BR /&gt;PROGRAM-ID. my-test.&lt;BR /&gt;DATA DIVISION.&lt;BR /&gt;WORKING-STORAGE SECTION.&lt;BR /&gt;01 X PIC X(6).&lt;BR /&gt;PROCEDURE DIVISION.&lt;BR /&gt;MY_MAIN SECTION.&lt;BR /&gt;MAIN.&lt;BR /&gt;    ACCEPT x FROM DATE.&lt;BR /&gt;    DISPLAY "Date : ", X.&lt;BR /&gt;    STOP RUN.&lt;BR /&gt;&lt;BR /&gt;$ type my_date.c&lt;BR /&gt;&lt;BR /&gt;#define MY_DATE_YYMMDD_LOGICAL_NAME "MY_DATE_YYMMDD"&lt;BR /&gt;#define MY_DATE_YYMMDD_LENGTH 6&lt;BR /&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;void dcob$acc_date( char *p )       // Return date as YYMMDD&lt;BR /&gt;{&lt;BR /&gt;char *my_date_pointer;&lt;BR /&gt;my_date_pointer = getenv (MY_DATE_YYMMDD_LOGICAL_NAME);&lt;BR /&gt;if (!my_date_pointer || strlen(my_date_pointer) != MY_DATE_YYMMDD_LENGTH) {&lt;BR /&gt;  fprintf (stderr, "Logical name %s not defined as %d char string!\n",&lt;BR /&gt;     MY_DATE_YYMMDD_LOGICAL_NAME, MY_DATE_YYMMDD_LENGTH);&lt;BR /&gt;  } else {&lt;BR /&gt;  strcpy ( p, my_date_pointer);&lt;BR /&gt;  }&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/STDIO.H&gt;&lt;/STDLIB.H&gt;&lt;/STRING.H&gt;</description>
    <pubDate>Wed, 28 Mar 2007 15:22:23 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-03-28T15:22:23Z</dc:date>
    <item>
      <title>DCOB$ACC_DATE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971462#M82812</link>
      <description>We have a large number of COBOL programs in use which obtain the system time by doing something like&lt;BR /&gt;&lt;BR /&gt;ACCEPT &lt;VARIABLE name=""&gt; FROM DATE.&lt;BR /&gt;&lt;BR /&gt;I've traced this to call to DCOB$ACC_DATE from DEC$COBRTL.EXE and am trying to write my own version of the routine to be used instead.&lt;BR /&gt;&lt;BR /&gt;The goal is that I be able to control the value a program receives from a call like the one above without changing the system date/time. I'm having issues with passing the dummy data back to the calling program, though.&lt;BR /&gt;&lt;BR /&gt;Could you please either tell me how to return the data to the calling program or suggest a workable alternative?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;James&lt;/VARIABLE&gt;</description>
      <pubDate>Wed, 28 Mar 2007 14:28:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971462#M82812</guid>
      <dc:creator>James Bard</dc:creator>
      <dc:date>2007-03-28T14:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: DCOB$ACC_DATE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971463#M82813</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;I suspect that to reliably achieve what your post seems to envision is somewhat different.&lt;BR /&gt;&lt;BR /&gt;The COBOL runtime should be requesting the system time, at the end using the appropriate system service. It is possible to fake this, and it has been done in the past, most commonly around the plethora of testing that was done before January 1, 2000. &lt;BR /&gt;&lt;BR /&gt;Replacing the COBOL call would possibly produce strange results, because there may be other software getting things through different paths. This would lead to an inconsistency, which could have serious repercussions.&lt;BR /&gt;&lt;BR /&gt;If I have been unclear, or can of futher assistance, please let me know.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Wed, 28 Mar 2007 15:07:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971463#M82813</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-03-28T15:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: DCOB$ACC_DATE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971464#M82814</link>
      <description>The code below works for me.&lt;BR /&gt;It assumes and verifies presence of a logical name with the selected 6 byte date value.&lt;BR /&gt;&lt;BR /&gt;Of course the default link will cause a 'multiple defined symbol'. A serious implemenation would take care of that and provide of all of:&lt;BR /&gt;&lt;BR /&gt;cob_acc_date      DDMMYY &lt;BR /&gt;cob_acc_time      HHMMSSNN&lt;BR /&gt;cob_acc_day       YYDDD&lt;BR /&gt;cob_acc_day_week  day of week 1-7&lt;BR /&gt;cob_acc_date_yyyy DDMMYYYY &lt;BR /&gt;cob_acc_day_yyyy  YYYYDDD&lt;BR /&gt;&lt;BR /&gt;But that would be like work!&lt;BR /&gt;(Which I'll gladly undertake for a fee. Send Email!).&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ type date.cob&lt;BR /&gt;&lt;BR /&gt;IDENTIFICATION DIVISION.&lt;BR /&gt;PROGRAM-ID. my-test.&lt;BR /&gt;DATA DIVISION.&lt;BR /&gt;WORKING-STORAGE SECTION.&lt;BR /&gt;01 X PIC X(6).&lt;BR /&gt;PROCEDURE DIVISION.&lt;BR /&gt;MY_MAIN SECTION.&lt;BR /&gt;MAIN.&lt;BR /&gt;    ACCEPT x FROM DATE.&lt;BR /&gt;    DISPLAY "Date : ", X.&lt;BR /&gt;    STOP RUN.&lt;BR /&gt;&lt;BR /&gt;$ type my_date.c&lt;BR /&gt;&lt;BR /&gt;#define MY_DATE_YYMMDD_LOGICAL_NAME "MY_DATE_YYMMDD"&lt;BR /&gt;#define MY_DATE_YYMMDD_LENGTH 6&lt;BR /&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;void dcob$acc_date( char *p )       // Return date as YYMMDD&lt;BR /&gt;{&lt;BR /&gt;char *my_date_pointer;&lt;BR /&gt;my_date_pointer = getenv (MY_DATE_YYMMDD_LOGICAL_NAME);&lt;BR /&gt;if (!my_date_pointer || strlen(my_date_pointer) != MY_DATE_YYMMDD_LENGTH) {&lt;BR /&gt;  fprintf (stderr, "Logical name %s not defined as %d char string!\n",&lt;BR /&gt;     MY_DATE_YYMMDD_LOGICAL_NAME, MY_DATE_YYMMDD_LENGTH);&lt;BR /&gt;  } else {&lt;BR /&gt;  strcpy ( p, my_date_pointer);&lt;BR /&gt;  }&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/STDIO.H&gt;&lt;/STDLIB.H&gt;&lt;/STRING.H&gt;</description>
      <pubDate>Wed, 28 Mar 2007 15:22:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971464#M82814</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-28T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: DCOB$ACC_DATE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971465#M82815</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;  Have a look at the OpenVMS Technical Journal V7&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/openvms/journal/v7/index.html" target="_blank"&gt;http://h71000.www7.hp.com/openvms/journal/v7/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;  My article "Faking it with OpenVMS Shareable Images" can solve this problem fairly easily (indeed it was exactly this problem - messing with COBOL dates for which I wrote my first fake shareable image in about 1988).&lt;BR /&gt;&lt;BR /&gt;  Using a fake RTL you can change the behaviour of any routine you choose, and apply it to an existing program without having to recompile or relink the originals. With a few logical name assignments you can change what date ACCEPT FROM DATE returns for any or all COBOL programs running on your system&lt;BR /&gt;&lt;BR /&gt;  Use the FAKE_RTL procedure to clone DEC$COBRTL. You can then edit the MACRO code for the fake RTL to "hijack" DCOB$ACC_DATE, you can also use the default fake rtl code to trace the arguments in and out of the routine to help you work out how to return values (ie: mechanism, data type &amp;amp; format).&lt;BR /&gt;&lt;BR /&gt;  My version used a logical name to define a time offset as a signed delta time. First call translated the logical name to find the offset, it then added the offset to the current time to determine the value to be returned to the caller.&lt;BR /&gt;&lt;BR /&gt;  The easiest approach is to write the hijack code in MACRO32 as it's mostly calls to system services and LIBRTL routines.</description>
      <pubDate>Wed, 28 Mar 2007 19:28:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcob-acc-date/m-p/3971465#M82815</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-03-28T19:28:59Z</dc:date>
    </item>
  </channel>
</rss>

