12-27-2015 05:26 AM
LENGTH kidname $ 4 sex $ 1;
INPUT famid kidname birth age wt sex ;
1 Beth 1 9 60 f
1 Bob 2 6 40 m
1 Barb 3 3 20 f
2 Andy 1 8 80 m
2 Al 2 6 50 m
2 Ann 3 2 20 f
3 Pete 1 6 60 m
3 Pam 2 4 40 f
3 Phil 3 2 20 m
if first.famid then weight = wt;
Guys my Question is that is there any way that I can see my answer only with familyID & total weight.
I dnt wanna see the rest of VAR..!! Please help me..!! ( Dnt wanna use drop & keep Fuct. )
12-27-2015 06:16 AM
First, everyone that posts questions are entitled answers if there's anyone who wishes to answers them. So please have a descriptive title for your question as subject, not a cry for help.
And why don't want to use keep/drop, when that's the simplest way to accomplish your question?
ANd by the way, what do you mean "see"?
If his is a report, you usually explicitly tell which variables you wish to present, regardless of what variables that is stored in the underlying data set.
12-27-2015 11:48 PM
First please allow me thank you for the answer ..!! And I would like to tell you that I m not crying for the ans. its just that i am new to sas supprt communities ..!!
So I am learning the thinks ..!! how to make it better..
Again thank you for your kind supprt & help..!!
12-27-2015 11:57 AM
As Linus mentioned, it's important to know how you are viewing the results. You could easily control the variables that print in a report:
proc print data=totalweight;
var famid weight;
However, if you are viewing the data set interactively, the easiest way would be to move those columns to the left and ignore the columns on the right. To move those columns to the left, modify the LENGTH statement so that it defines them first:
LENGTH famid weight 8 kidname $ 4 sex $ 1;