BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
prislo
Fluorite | Level 6

Hello!

 

I'am new in sas programming and i have some doubts about create datasets.

I'd like to know how is the best and faster way to copy databases from oracle to sas librarys.

 

I already do a simple code to create a database but I realized it was slow.

 

 

DATA WORK.t013_proposta_201802;
   SET ORA_LIB.T013_PROPOSTA;
   WHERE put(DATEPART(AT013_DTA_INCLUSAO), yymmn6.) = '201802';
RUN;

NOTE: The data set ABN_DS.T013_PROPOSTA_201802 has 22881 observations and 156 variables.
NOTE: DATA statement used (Total process time):
real time 15:38.93
cpu time 4:32.35

 

Is there a faster and more performative way to do this?

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
kiranv_
Rhodochrosite | Level 12

this may help and worth a try to use in database processing by using explicit pass through

 

I have pasted the code from http://support.sas.com/kb/41/616.html

datepart code should be very similar, change the where clause to oracle datepart from below code

and a quick google search will you help with datepart code

 

 

proc sql; connect to oracle(user=user password=password path=path);

create table work.job204 as

select * from connection to oracle

(select * from Employees where jobcode=204); quit;

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Not sure how we can help.  Is the connection to oracle running as fast as possible, where is SAS located, is the network speed good.  Is there a large amount of data, could you create a temporary table on the database with the filtered information so less is transmitted etc.

 

And please do not code all in uppercase, I don't want to be shouted at!

andreas_lds
Jade | Level 19

The difference between real time and cpu time indicates that the sas-process is waiting for data. So talk to the oracle admins and network staff.

kiranv_
Rhodochrosite | Level 12

this may help and worth a try to use in database processing by using explicit pass through

 

I have pasted the code from http://support.sas.com/kb/41/616.html

datepart code should be very similar, change the where clause to oracle datepart from below code

and a quick google search will you help with datepart code

 

 

proc sql; connect to oracle(user=user password=password path=path);

create table work.job204 as

select * from connection to oracle

(select * from Employees where jobcode=204); quit;

prislo
Fluorite | Level 6

Perfect!!

 

I made some changes and it worked correctly!

It worked very fast, in a few seconds.

 

Thanks so much!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1573 views
  • 5 likes
  • 4 in conversation