BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

I have exported a CSV file from a location to SAS and now I am adding some information from the database. But I am not able to link that CSV file information from the database. I am missing something to link the information. Can you please guide? Here is the import step:

Proc import
datafile='\\test2.local\shares\public\Trace\Full_manual_trace_book.csv'
out=Manual_trace_full
dbms=csv
replace;
run;

Then I run this code to add further information to the accounts in imported file


proc sql;
connect to oledb (provider=sqlncli11.1
properties = ("Integrated Security" = SSPI
"Persist Security Info" = False
"Initial Catalog" = pinsys
prompt = NO
"Data Source" = 'ELECTRA'
read_lock_type = no));
create table Manual_tracing as
select t2.debt_code,
t2.tran_code,
t2.td_altdescrn,
t2.td_stddescrn

from (select * from connection to oledb
(select
b.debt_code,
b.tran_code,
c.td_altdescrn,
c.td_stddescrn

from [Pinsys].[dbo].[debt_trans] as b
inner join [Pinsys].[dbo].[transdescrn] as c
on b.Tran_code = c.Tran_code
where b.tran_code in ('JO741','JO742',);)) as t2

order by t2.debt_code;
quit;

 

When I run the 2nd code, it takes the data from the database in thousands but my file just have few accounts. I am looking to add those extra information to those few accounts.

2 REPLIES 2
LinusH
Tourmaline | Level 20

It's all about understanding the information and the data that you work with. 

It's very hard for outsiders to chime in here.

Please try to connect with persons at your site that has insight in the data, and can help you specify the desired outcome of your work.

Data never sleeps
Tom
Super User Tom
Super User

Are you asking how to push the information you got from the CSV file back into the remote database?

 

Or perhaps you asking how to the extract some type of list of key identifiers from the CSV file and use that list to control which observations you pull from the remote database so that SAS does not try to pull all of the observations from the remote database?

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!

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
  • 2 replies
  • 451 views
  • 0 likes
  • 3 in conversation