Hi All,
I am having following dataset with stock values.daily the values will change , i need to find dynamically , values less than .5 and create a macro variable.
data have;
input name stockrate;
datalines;
xyz 0.015
abc 0.9
fxy .86
tdf .02
boa .76
wfd .005
;
run;
in the above case there are 3 companies less than .5(xyz,tdf,wfd). latest data may change to other companies. right no i am enter manually like checking stockrate and enter the company names.
like %let stat=xyz tdf wfd
i am looking for dynamic approach to check the values , and pick the company names and fill the %let stat = (what ever the companies <.5)
Any insight on this
Thanks
sam
proc sql;
select name
into :Stat separated by ' '
from have
where stockrate < .5;
quit;
proc sql;
select name
into :Stat separated by ' '
from have
where stockrate < .5;
quit;
Thank you DBailey,
This is what i am looking for
Thank you once again
Sam
Hi ,
We can also do the same through the sasdataset .
%macro low ;
data low_&sysdate ;
set have ;
where stockrate < 0.5 ;
run;
%mend ;
%low ;
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 save with the early bird rate—just $795!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.