Quantcast
Viewing all articles
Browse latest Browse all 310

Variable and Dataset Confusion

I have imported an Excel spreadsheet into SAS as WORK.X1. I am trying these lines:

proc freq data = x1 ;
data x2 ;
PhysicalAggression = (Aggress9 + Aggress10 + Aggress11 + Aggress12) /4 ;
run;

The log tells me that the Aggress variables are uninitialized. I guess this means that the attention of SAS has shifted from x1 to x2, where it finds no such variables? This is why the output contains information for the Aggress variables but not for PhysicalAggression?

If I delete the "data x2" line, I get an error indicating that PhysicalAggression is not valid or is used out of order. This is perhaps because there is no column in the Excel input labeled PhysicalAggression?

Needless to say, I'd like to be able to proceed to use PhysicalAggression -- the variable, I mean. But I'm stuck.

I have a bit of acquaintance with variables, but the guides I've found are pretty opaque for me. I wouldn't mind buying a beginner's guide to SAS syntax, but in the interests of time would be especially interested in something available now online.

Thanks.

Viewing all articles
Browse latest Browse all 310

Trending Articles