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 </>
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.