BookmarkSubscribeRSS Feed
Obsidian | Level 7


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?

Super User

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 </>



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3 in conversation