proc-sql

SQl PAssthrough in SAS

Are there any advantages in using SQL PAssthrough facility along with SAS. ...

Dropping a table in SAS

What is the most efficient way to drop a table in SAS? I have a program that loops and drops a large number of tables, and would like to know if there is a performance difference between PROC SQL; and PROC DATASETS; for dropping a single table at a time.. Or if there is another way perhaps??? ...

Is it possible to do a case-insensitive DISTINCT with SAS (PROC SQL)?

Is there a way to get the case-insensitive distinct rows from this SAS SQL query? ... SELECT DISTINCT country FROM companies; The ideal solution would consist of a single query. Results now look like: Australia australia AUSTRALIA Hong Kong HONG KONG ... where any of the 2 distinct rows is really required One could upper-case the...

Teradata and SAS with BigInt's

We have a teradata database that is filled with BIGINT datatypes. SAS is the primary analytic engine for the organization. The SAS access library chokes on BIGINT and therefore forces all code to cast variables into a integer or decimal before returning them to SAS. Example: proc sql; connect to database (blah blah); create table sas_da...

Help with Correlated Queries in SQL

Please help!! I am brand new to SQL programming and am teaching myself everything as I go along. I’ve finally run into a problem I can’t seem to tackle. Hopefully someone can help. I have the following tables. What I need to do is use the RECDATE in FROISEDI and count all the distinct dates (I4C7DZ) prior to and including that date ...

SAS Proc SQL Database Table Insert

Using SAS's Proc SQL, is there a way to insert records from a SAS Dataset into a table in the open SQL Server connection? Something like this (which doesn't work): proc sql exec; connect to sqlservr as DataSrc (server=my-db-srvr database=SasProcSqlTest); create table Items as select * from connection to DataSrc ( SELECT * FROM ...

Proc SQL Delete takes WAY too long

I'm running the following SAS command: Proc SQL; Delete From Server003.CustomerList; Quit; Which is taking over 8 minutes... when it takes only a few seconds to read that file. What could be cause a delete to take so long and what can I do to make it go faster? (I do not have access to drop the table, so I can only delete all rows) ...

SAS to Oracle ODBC - passing a SAS table INTO the database

Can anyone please advise the syntax for passing a table FROM a SAS library INTO an oracle database? example code below (although obviously the connection to the WORK library cannot be referenced in this way) PROC SQL noprint; connect to ODBC as X (dsn='ALIAS' uid='USER1' pwd='passwd' quote_char=''); exec (CREATE TABLE Test AS SELEC...