Help using Base SAS procedures

dynamic call

Accepted Solution Solved
Reply
Regular Contributor
Posts: 168
Accepted Solution

dynamic call

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


Accepted Solutions
Solution
‎05-09-2014 03:58 PM
Super Contributor
Posts: 578

Re: dynamic call

proc sql;

select name

into Smiley Frustratedtat separated by ' '

from have

where stockrate < .5;

quit;

View solution in original post


All Replies
Solution
‎05-09-2014 03:58 PM
Super Contributor
Posts: 578

Re: dynamic call

proc sql;

select name

into Smiley Frustratedtat separated by ' '

from have

where stockrate < .5;

quit;

Regular Contributor
Posts: 168

Re: dynamic call

Thank you DBailey,

This is what i am looking for

Thank you once again

Sam

Contributor
Posts: 30

Re: dynamic call

Hi ,

We can also do the same through the sasdataset .

%macro low ;

data low_&sysdate ;

set have ;

where stockrate < 0.5 ;

run;

%mend ;

%low ;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 215 views
  • 0 likes
  • 3 in conversation