Good day
I am new to sas ds2. I kindly request an assistance.
I have been trying to create a macro variable using 2 methods.
using select into: and call symput but both does not work
proc ds2;
data _null_;
method run();
SET {select interest_rate into :rate from elookup.interest_rate where
information_date in (select max(information_date) from
elookup.interest_rate) where infomation_date=max(infomation_date)};
end;
enddata;
run;
quit;
i am getting this error below.
ERROR: Compilation error.
ERROR: Syntax error at or near ":"
ERROR: Line 79: Unable to prepare SQL query (rc=0x80fff802U).
You cannot have an SQL SELECT statement that both returns its results as a dataset and also generates macro variables.
Since you are using the SELECT statement to return data to your DS2 data step remove the INTO clause from the SQL.
Or if you just want to set macro variables then use PROC SQL instead of PROC DS2 to run the SELECT statement.
Hi
I have tried Fedsql I didn't come right.
Why won't you use proc sql?
hi there is a thin line between sas and sas ds2, which in my mind proc sql is being replaced by fedsql.
> proc sql is being replaced by fedsql.
No at all. Different tools for different purposes.
Likewise DS2 does not replace the data step. DS2 is better some some tasks (heavy multithreading on distributed platforms) and much slower on the wrong hardware.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.