Previous PageNext Page

Creating more than one data set with a single data step
Up to now we have created only one data set with a data step, but you can create several at the same time. You need to instruct SAS about

Example 6.1 from C&P (slightly modified):

Proc Sort data=Demog2;
	By ID;
Proc Sort data=Employee;
	By EmplyID;

Data Active                           /* All PDV variables are kept */
     Inactive (keep=ID Gender State); /* Only those vars listed are kept */
	Merge Demog2 
         Employee (In=Act Rename=(EmplyID=ID));
	By ID;
	If ACT Then Output Active;         /* Active contains those records */
	       Else Output Inactive;       /* with info from Employee.      */

Previous PageTable Of ContentsNext Page