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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1266 views
  • 0 likes
  • 2 in conversation