I have following sas view with where condition. First time I pass the value of User_date as 1Jan2016 and view become fixed.
Now if I change the user date to 2Jan2016, it shows me 1Jan data. I tried it with diferent session but view is resulting in 1 Jan records.
I want to have view with flexibility to show me different record if I change the value of User_date.
proc sql;
create view temp_view as
select *
from table1 where RUN_DATE = &USER_DATE;
quit;
proc sql;
create view temp_view as
select *
from sashelp.class where sex=symget('USER_DATE');
quit;
%let USER_DATE=F;
proc print data=temp_view ;run;
%let USER_DATE=M;
proc print data=temp_view ;run;
proc sql;
create view temp_view as
select *
from sashelp.class where sex=symget('USER_DATE');
quit;
%let USER_DATE=F;
proc print data=temp_view ;run;
%let USER_DATE=M;
proc print data=temp_view ;run;
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!
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.