Sunday, July 25, 2010

Double Dash


Usually to keep a set of variables with same prefix we use “-“

For example:

COL1 COL2 COL3 COL4 COL5 COL6 COL7

To keep the above variables, we use (keep COL1 - COL7;)

but what if the variables does not have same prefix?

Yes, there is another way to keep the variables even when they do not have same prefix!

“--“ can be used to keep the variables in the order in which they occur in a dataset.

data dummy;
input a b1 b2 c;
datalines;
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
;
run;

data dummy1;
set dummy;
keep a -- b2;
run;

More:
http://studysas.blogspot.com/2009/07/even-you-can-use-hash-and-double-dash.html

No comments:

Post a Comment