data hs;
do x=0 to 5 by 0.1;
y=x*sin(2*x);
output;

end;
proc gplot data=hs;
plot y*x;
symbol i=join v=star;
run;


data hs2;
do x=0 to 5 by 0.1;
z=cos(x);
output;
end;
proc gplot data=hs2;
plot z*x;
symbol i=join v=star;
run;

 

data _null_;
%let m1=10/2;
%let m2=10.5/3;
%let c1=%eval(10/2);
%let c2=%eval(10.5/3);
%let c3=%sysevalf(10.5/3);
 %put m1=&m1 m2=&m2  c1=&c1 c2=&c2 c3=&c3;
run;
;


%let city1=Shanghai;
%let city2=Beijing;
%let city3=Guangzhou;
%let city4=chongqing;
%let city5=Hangzhou;
%macro test;
%do i=1 %to 5;
%put &&city&i;
%end;
%mend test;
%test
 

 

%let var=city;
   %let n=6;
   %put &&&var&n;
      %put &&var&n;
      %put &var&n;
run;


data A ;

input n1-n10;

cards;

1 2 3 2 1 4 3 2 4 2
2 1 1 4 3 2 4 2 2 .
2 4 2 2 . 2 1 1 4 3
2 1 3 1 4 2 1 2 3 1
2 1 2 3 2 1 . 2 1 2

;
run;


data b;
array a{*}n1-n10;
set a;
do i=1 to 10;
if a{i}=1 | a{i}=2 then a{i}=1;
if a{i}=3 | a{i}=4 then a{i}=2;
if a{i}>4 then a{i}=10;
end;
drop i;
run;

 

DATA out1;           
  INPUT Income Age; 
  DATALINEs;    
  1500 23       
  2600 35       
  2000 28       
  3000 30       
  1800 19       
  ;   
run;

 

 %let dsn=out1;
  %let yvar=Income;
 %let xvar=Age;
 %let plot=%str(
Proc plot;
plot &yvar*&xvar;
run;
);
 &plot;
 DATA temp;
  set &dsn;
 if Age>=20;
 &plot;
 Proc print;
Title subsetof &dsn;
 run;


 %MACRO plot;
 data c;
 input Income age;
set A;

 run;


 %MEND;
  %plot;
  &plot;