Hello.
I recently started learning programming in sas.
Who can tell you how to create a permanent symbolic link?
When performing any tasks, I often turn to the database with an sql query, which should be executed in the database server and return the result to me.
This is how I do it:
proc sql;
connect to oracle (AuthDomain = "Oracle_Auth" PATH = "@ dev-db.sas.ru:1521/SASDEV");
select * from cdm.ci_campaign;
disconnect from oracle;
quit;
Here's how I would like to simplify it:
proc sql;
&connectORA.;
select * from cdm.ci_campaign;
disconnect from oracle;
quit;
Put your connection information into a macro:
%macro connectORA;
connect to oracle (AuthDomain = "Oracle_Auth" PATH = "@ dev-db.sas.ru:1521/SASDEV");
%mend;
and call it in your SQL:
proc sql;
%connectORA;
select * from connection to oracle (select * from cdm.ci_campaign);
disconnect from oracle;
quit;
I your example, no CONNECT and DISCONNECT would be needed, as the SELECT works directly from a SAS library (which might be defined as a connection to Oracle on its own). But I guess that CDM is in fact a schema in the Oracle database, and not available in the SAS environment on its own.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.