title "Listing of SASHELP.CLASS Grouped By Age (BY statement)"; proc print data=class_sort; by Age; run;
title "Listing of SASHELP.CLASS Grouped By Age (BY and ID statements)"; proc print data=class_sort; by Age; id Age; run; title;
%macro defaults ; %if %symexist(dset)=0 %then %do; %global dset; %let dset=sashelp.class; %end; %if ^%symexist(start) %then %do; %global start; %let start=0; %end; %if ^%symexist(limit) %then %do; %global limit; %let limit=160; %end; %mend defaults; %defaults
%local l_obs l_title; %let l_obs = 4; /* n_obs set to 4 */ %let l_title =A Test with SASHelp.Class;
data test; set sashelp.class; run;
PROC EXPORT DATA= sashelp.class OUTFILE= "&path\data\class.csv" DBMS=csv REPLACE; RUN;
/********************************************************************** * PRODUCT: SAS * VERSION: 9.1 * CREATOR: External File Interface * DATE: 11APR09 * DESC: Generated SAS Datastep Code * TEMPLATE SOURCE: (None Specified.) **********************************...
data a; if eof then put total=; set sashelp.class end=eof; end=eof; total+age; put 'last ' age= total= eof=; run;
options nomprint nomlogic nosymbolgen; * Build an example data set with some differences; data class2; set sashelp.class; if _n_=3 then sex = 'G'; if _n_=3 then height=12; if _n_=5 then age = 45; run;
* compare the two data sets; %autocompare(base=sashelp.class, compare=class2, bylist=name, varlist=age height sex)