Hi Team,
I have created a SAS table by Proc Sql and then tried to create another table from the table created first like teh below example:
Proc SQL;
CREATE TABLE A AS SELECT * from B;
quit;
PROC SQL;
CREATE TABLE C AS SELECT * from A;
quit;
When I try executing the second SQL query I am getting error as A not found.
Kindly Help.
Your code seems to be working on the following simple test data?
data B;
input var1 var2;
datalines;
1 2
3 4
5 6
;
Proc SQL;
CREATE TABLE A AS SELECT * from B;
quit;
PROC SQL;
CREATE TABLE C AS SELECT * from A;
quit;
See log below
It is just an example on what I am working on explained in the below steps.
Can you provide some sample data or some of the actual code you are using, because nothing is wrong in the code you have posted above 🙂
@simrut wrote:
PROC SQL;
Create Table Employee AS SELECT A.NAME,A.SALARY,B.DEPT FROM EMP1 A LEFT JOIN DEPARTMENT B ON A.EMP_ID= B.EMP_ID ;
QUIT;
/***************************************************/
PROC SQL;
CREATE TEMPLE TEMP AS SELECT * FROM EMPLOYEE;
QUIT;
I am getting error 'Employee not found'
Hope this helps:)
Post the log of both of those steps when running them in immediate succession.
@simrut wrote:
PROC SQL;
Create Table Employee AS SELECT A.NAME,A.SALARY,B.DEPT FROM EMP1 A LEFT JOIN DEPARTMENT B ON A.EMP_ID= B.EMP_ID ;
QUIT;
/***************************************************/
PROC SQL;
CREATE TEMPLE TEMP AS SELECT * FROM EMPLOYEE;
QUIT;
I am getting error 'Employee not found'
Hope this helps:)
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.