Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: date problem



It's been many years since I was working with VMS and Rdb, but I would say that your results are OK.

The date 17-nov-1858 corresponds to a binary 0 in the time_bin variable.

My hypothesis is that either one has occurred:

  1. the call to $BINTIM did not succeed and for such an occasion you should check the returned status code for even/odd values. Remedy: change your code so that status is checked. Change datatype and/or argument passing mechanism for time_bin in the call to $BINTIM.
  2. the conversion implied by "component.p_date := time_bin;" gave results not expected by you; if this is the case, you will easily find it in the debugger. Remedy: change datatype for time_bin to adjust it to the datatype represented by component.p_date.
Anyway, using and checking status codes is a nice practice that I would recommend in all occasions whenever using VMS services.

Hope that can be of some help. Sorry for not being more specific, but it's almost 5 years ago I saw a VMS machine. Good to know VMS and Rdb are still going strong!

regards /ZJ

llhuall wrote:

Hi there

I had a alpha vms v7.1-2 and rdb v7.0-64

Pascal languge
type
     $UQUAD  = [QUAD,UNSAFE] RECORD
                           10:  UNSIGNED;
                           11:  UNSIGNED;
                             END;
VAR
time_acscii :packed array [1..23] of char;
time_bin    :$UQUAD;

time_acscii := '17-SEP-2003 10:05:29.09';
$BINTIM(timbuf := time_ascii, timadr = time_bin);

database table component has a p_date field, type is date vms
when I use component.p_date := time_bin;  insert record,
p_date vaule in database is 17-NOV-1858 00:00:00.00

When I use $BINTIM(timbuf := time_ascii, timadr :=component.p_date),
insert record, p_Date value in database is correct,

I am wondering if somebody can give me a help. Thanks in advance

Lionel

begin:vcard 
n:;Ziemowit
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
fn:Ziemowit Jankowski
end:vcard


<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.