BookmarkSubscribeRSS Feed
Aexor
Lapis Lazuli | Level 10

Hello Members,

 

I need help in understanding , How can we update table same table after join in proc sql

 

proc sql;
create table &lbname..&inputTable
select p.*, e.time_id as start_dt_sk
from &lbname..&inputTable. p ,
&plan_lib..t_&inputTable._end e
where
p.%bquote(&time_dim.) between e.start_date and e.end_date;
quit;

 

ignore macro variable these are getting resolved perfectly. My doubt is can we create table like these where from table name and create table is same ?

 

do we have replace option here in proc sql ?

 

Also &lbname..&inputTable. table is having larger volume of records around 17M. Please help me with best possible way to resolve this.

 

Thanks!

 

 

 

 

1 REPLY 1
Tom
Super User Tom
Super User

Normal SAS is probably smart enough to do that.  What is does when you are creating a NEW dataset like that is write the dataset first.  Then when it finishes writing successfully it deletes the old one and renames what it just wrote to the desired name.

 

But if &LBNAME is a libref that is defined using SAS/Access to some external database then you have to worry about what that database allows.  Most will not let you create a dataset with the same name as an existing dataset.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 605 views
  • 0 likes
  • 2 in conversation