DATA Step, Macro, Functions and more

Identifying Observations

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Identifying Observations

DO we have to use NOOBS while using ID? 


Accepted Solutions
Solution
‎08-19-2016 04:06 PM
Respected Advisor
Posts: 4,922

Re: Identifying Observations

Posted in reply to SamuelRajKandru

I guess you are talking about proc print. I think using a ID statement implies option NOOBS, since the ID variable is supposed to provide observation identification. Compare:

 

proc sort data=sashelp.class out=class; by sex name; run;

proc print data=class; by sex; run;
proc print data=class; by sex; id sex; run;
proc print data=class noobs; by sex; id sex; run;
PG

View solution in original post


All Replies
Super User
Posts: 19,802

Re: Identifying Observations

Posted in reply to SamuelRajKandru

You haven't provided enough info regarding your problem. 

Please explain your question in more detail. 

Contributor
Posts: 45

Re: Identifying Observations

Ummm, I was going through Chapter 4 of the SAS Cert Prep Guide. So inorder to eradicate the OBS column, we use a NOOBS. My question is, do we have to write the NOOBS in the code even when we use an ID statement? Or is it not necessary to mention the NOOBS in the code while using the ID statement?
Solution
‎08-19-2016 04:06 PM
Respected Advisor
Posts: 4,922

Re: Identifying Observations

Posted in reply to SamuelRajKandru

I guess you are talking about proc print. I think using a ID statement implies option NOOBS, since the ID variable is supposed to provide observation identification. Compare:

 

proc sort data=sashelp.class out=class; by sex name; run;

proc print data=class; by sex; run;
proc print data=class; by sex; id sex; run;
proc print data=class noobs; by sex; id sex; run;
PG
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 259 views
  • 0 likes
  • 3 in conversation