Date: Fri, 17 Mar 2006 15:54:12 -0500
Reply-To: "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Subject: Re: SAS Append on Server
Content-Type: text/plain; charset="iso8859-1"
What type of VALUE Sybase expecting in the datetime / bit fields?
Because it's passed through to Sybase, you'll have to ensure the values
in your macro variables are exactly what Sybase wants. For instance,
while SAS dates are the number of days since Jan 1, 1960, it appears as
though Sybase uses Jan 1, 1900 as its base. You'll have to adjust your
number accordingly.
Looking at the OnlineDocs for SAS/Access, the following appears
pertinent:
BIT
BIT data has a storage size of one bit and holds either a 0 or a 1;
other integer values are accepted but are interpreted as 1. BIT data
cannot be NULL and cannot have indexes defined on it.
SMALLDATETIME
SMALLDATETIME data is 4 bytes long and consists of one small integer
that represents the number of days after January 1, 1900, and one small
integer that represents the number of minutes past midnight. The date
range is from January 1, 1900, to December 31, 2079.
DATETIME
DATETIME data has two 4-byte integers. The first integer represents the
number of days after January 1, 1900, and the second integer represents
the number of minutes past midnight. Values can range from January 1,
1753 to December 31, 9999.
DATETIME values are input as quoted character strings in various
alphabetic or numeric formats. Time data must be entered in the
prescribed order (hours; minutes; seconds; milliseconds; AM, am, PM, pm)
and must include either a colon or an AM/PM designator. Case is ignored,
and spaces can be inserted anywhere within the value.
When you input DATETIME values, the national language setting determines
how the date values are interpreted. You can change the default date
order with the SET DATEFORMAT statement. See your Transact-SQL
documentation for more information.
You can use SYBASE built-in date functions to perform some arithmetic
calculations on DATETIME values.
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of Faiyazmehadi Momin
Sent: 2006, March, 17 3:49 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS Append on Server
Hi David,
I figured out the bug. It was wtih the settings in ODBC. The server
ODBC setting for performance was set to Direct. Due to which the ODBC
connection was now working. When I set it to Cursor, it worked perfect.
Thanks for your suggestion.
However now I have new issue of passing the parameter to stored
procedures. how do we pass Bit and Datetime values to stored procedures.
Your suggestion would be very helpful.
proc sql;
connect to ODBC as Conn2(dsn='ODBC connection' user=USER1
password=PWD1); execute (EXECUTE Ins_NewTask_PAR &rows,
&ClinicalPatientID, "&AssignedToTeam", "&Notes", "&UserID", "&TaskType",
"& AssignedToUser", &ProcessedDate) by conn2; disconnect from conn2;
quit;
Where Rows and l;ocked is Bit integer and Processeddate is Datetime
Thank you
Faiyaz
_______________________________________________________________________
This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.
Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite.
Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.