| Date: | Fri, 23 May 2008 12:27:51 -0400 |
| Reply-To: | Bob_Abelson@HGSI.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Bob_Abelson@HGSI.COM |
| Subject: | Re: what is wrong with this proc sql ? |
|
| In-Reply-To: | <soSdnYCsRb7udqvVnZ2dnUVZ_vCdnZ2d@earthlink.com> |
| Content-Type: | text/plain; charset=us-ascii |
Thomas,
I'm not very familiar with Sybase, but I'm pretty sure that SUBSTR and PUT
don't work in Sybase. What may work is this:
proc sql;
connect to sybase (user=me pass='pass' server=ZAP);
create table x as
select y, z from connection to sybase
(select y, z, K9
from my_db)
where substr(put(K9,9.),1,3) in ('100')
;
disconnect from sybase;
quit;
Bob Abelson
HGSI
240 314 4400 x1374
bob_abelson@hgsi.com
"Thomas S." <tho@M.AS>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
05/23/2008 12:15 PM
Please respond to
"Thomas S." <tho@M.AS>
To
SAS-L@LISTSERV.UGA.EDU
cc
Subject
what is wrong with this proc sql ?
short job that runs on sas 9.1.3 sp 4 on unix
* this works fine ;
proc sql;
connect to sybase (user=me pass='pass' server=ZAP);
create table x as
select * from connection to sybase (
select y, z
from my_db
); disconnect from sybase;
quit;
* this does not work, complains about use of put or input ;
* the length of K9 is 9 bytes, numeric, like 100100100 ;
proc sql;
connect to sybase (user=me pass='pass' server=ZAP);
create table x as
select * from connection to sybase (
select y, z
from my_db as a
where substr(put(K9,9.),1,3) in ('100')
); disconnect from sybase;
quit;
|