BookmarkSubscribeRSS Feed
IgorR
Quartz | Level 8

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?

2 REPLIES 2
ballardw
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.

andreas_lds
Jade | Level 19

Hardly possible to help without seeing the log posted as text using the insert code button </>

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 483 views
  • 0 likes
  • 3 in conversation