I am using SAS Studio and SAS VA. I have 3 tables and left joined successfully and want to retrieve all the records with all fields. The query result comes up with the desired output but when I encapsulate query inside the create table statement, it retrieves only 542 fields out of 721 fields. Please find below the code for your reference:
Create table OBS_ENG_AP_COMPLT AS
from table a left join
ON a.id = b.id left join table c
ON a.id = c.id
Your code is joining table to itself 3 times. You are not joining table a, table b and table c.
Maybe you want:
proc sql; Create table OBS_ENG_AP_COMPLT AS Select * from a left join b ON a.id = b.id left join c ON a.id = c.id; quit;
What does your SAS log report regarding the number of rows and columns created? It will be similar to this:
NOTE: Table WORK.TEST created, with 19 rows and 5 columns.
Please note that if your input tables have common column names then only the columns from the first table will be selected.
SAS is headed back 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.
Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.