BookmarkSubscribeRSS Feed
L777
Fluorite | Level 6

 

When I try to merge two datasets by using "proc sql", I always meet this issue. This is my code:

Proc sql; 

create table lab.data2 as 

slelct a*, b. BMI 

from lab.data1 as a 

left join lab.data as b 

on a. ID=b.ID; 

run; 

 

I wonder if is there a compress option for "proc sql".  How can I write the code with that option? Additionally, I have already changed sasv9 and set sasuser and work file under D drive.

 

"lab" folder was saved under Box under C drive. I wonder if it is better to save the new dataset offline rather than online in Box.  I think the C disk is full may also be due to Box. Does anyone meet the same situation? How to deal with that?

 

2 REPLIES 2
SASKiwi
PROC Star

Open Windows Explorer and check how much free disk space you have on D and C drives. It's not clear from your description which drive you are running out of space on as you will be writing to both. Delete any unwanted files on these drives. Check your D SASWORK folder and delete any old _TDnnnn folders that aren't for your current SAS session. If you have freed up significant space, try rerunning your program. 

Kurt_Bremser
Super User

Have you made sure (by using PROC SORT with NODUPKEY) that ID is unique in at least one of the datasets, or is this a many-to-many join?

How large are the datasets (number of observations, total file size for lab.data1)?

Depending on this information, a sequence of PROC SORTs and a DATA step can do it, and if lab.data is not too large (number of observations) and unique with regard to ID, a single DATA step with a hash object will achieve your join much more efficiently.

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
  • 561 views
  • 0 likes
  • 3 in conversation