Dropping Observation Numbers - SAS Programming

One of the first changes you may want to make in this listing is to remove the column labeled OBS (observation number).You can do this two ways: First,you can include the PROC PRINT option NOOBS.

This is fine when your variables all fit across one page.If this is not the case, your output will be difficult to read since the continued list of variables will not contain any identifying information.

The alternate method is to include one or more ID variables.An ID variable replaces the OBS column and prints on the left side of the page,even if the list of variables is continued on other pages.Here is the program modified to include an ID variable:

Example

PROC PRINT OATA-MEDICAL;
ID SUB_ID;
VAR DIAGCODE
A0MITJ)T
DISCHJXT
HOSPCODE
LOS
COST;
RUN;

Notice that SUB_ID is removed from the variable list.If you leave it in, it appears twice on the listing,once as the ID variable and once as one of the VAR variables.The output from this example is identical to the except that the column labeled OBS is removed.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAS Programming Topics