Previous PageNext Page

Using both forms of Subsetting - Error?
Create a data set with just the male's Height and Weight.

Data MHtWt;
     Set library.Survey12 (KEEP= Subj Height Weight);
     IF Gender = 'M';     

The log says something that isn't true:

ERROR: Variable GENDER is not on file LIBRARY.SURVEY12.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HTWT may be incomplete.  When this step was stopped there were 0 observations and 3 variables.

Why does SAS think that GENDER is not in the file?
Would a WHERE statement instead of an IF statement fix the problem?

Previous PageTable Of ContentsNext Page