Date: Tue, 8 May 2001 22:19:58 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Alderton Ph.D." <David.Alderton@ATT.NET>
Subject: Help with DateTime22.3 format
Content-Type: text/plain; charset="iso-8859-1"
I'm pulling data off a SQL Server 7 database. One of the variables is the
date a survey was filled out. It comes across as a SAS numeric variable
with a datetime22.3 format. For example '07FEB2001:09:30:20.177' is one
value with a crazy numeric translation of 1297157420.177 which I guess is
the number of minutes since some date. Anyway, what I am trying to do is
subset the data as I bring it across from the server based on the last time
I pulled the data. Say I pulled the data from the beginning of the survey
until 4 April 01. This time I want to get just the surveys that have been
filled out since 4 April 01 (to today). I cannot for the life of me figure
out how to translate the datetime22.3 into just a traditional date (e.g.,
'04APR01'd) nor can I figure out how to create a variable on the same metric
as the datetime22.3 value to use for comparison.
Ideally, I simply want to create a constant for use in a subsetting "if"
if Srvy_DT > XXX;
Where XXX would be directly comparable number to Srvy_DT (datetime22.3
format). Or, I want to translate the Srvy_DT into a standard date
'04APR01'd and then compare it to another standard date.
Can anyone help? I have never used dates in this format and I am stumped.
David L. Alderton, Ph.D.
Institute for Selection and Classification
Navy Personnel Research, Studies, and Technology
Navy Personnel Command