Hi!
I have a SAS project that has multiple programs in single Process Flow.
One of programs include multiple SQL queries, when every query is in separate Proc SQL, like this example:
/* Merge data from Tables */
Proc SQL;
Create Table A As
Select *
From TableA;
Quit;
Proc SQL;
Create Table B As
Select *
From TableB;
Quit;
Proc SQL;
Create Table Merged As
Select A.*, B.*
From A
Inner Join B
On A.ID = B.ID;
Quit;
The problem is that when I run the whole program, the table A is empty and Table B has values.
But if I run Proc SQL for table A only I do receive table A with values.
What could be a problem?
Show us the log with all the code and all messages.
Show the code where you "run Proc SQL for table A only I do receive table A with values." from the log.
One suspects that you are doing something that part way through the code you reuse A as a table name incorrectly.
Or are looking at the wrong data set. Your table Merged would be empty if none of the ID values in A match any in B.
Hardly possible to help without seeing the log posted as text using the insert code button </>
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.