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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 2 replies
  • 537 views
  • 0 likes
  • 3 in conversation