![]() ![]() To get a listing of a data set without the observation numbers, use the noobs option: To get a listing of the values in a data set with the variable labels (if any) displayed, use the label option: Some examples of listing variables are shown below: Variables will be printed in the order they are listed, and the order need not follow the order of the variables in the data set. The variables that are printed in proc print can be restricted by giving a variable list in a var statement after the proc print statement. Proc print data = march(firstobs=182 obs=185) To list observations 182 through 185, the following commands could be used. The obs= data set option tells SAS the last observation to process. The firstobs= data set option tells SAS the first observation in the data set to process. The cases that are listed can be restricted by using combinations of the firstobs= and obs= data set options. To list the first 10 observations in the data set, use the (obs= ) data set option, immediately following the data set name. However, to be more specific, you can tell SAS the data set that you wish to have printed by using the data = option in the proc print statement, as shown below. To get a listing of all cases and all variables in a data set, use the following syntax:īy default, Proc Print will list values for the most recently created SAS data set. Proc Print is named somewhat deceptively, because it does not actually send data to a printer, but simply lists the values of each variable in the output window. Proc Print can be used to view a SAS data set. ![]() Note: if you use the data step commands to read in the raw data, the variables will not have any labels, but if you import the data from Excel, SAS will give each variable a label that corresponds to the name of the variable on the first row of the Excel file. ![]() Īlternatively, you can import the Excel file, MARCH.XLS, by using the SAS Import Wizard, or by using Proc Import commands, as shown below: The procedures introduced are:Ĭheck the SAS Procedures Guide or SAS online documentation for more information about these procedures.Ĭommands to read the raw data file, MARFLT.DAT, using a data step are shown below:įormat date mmddyy10. This handout covers the use of SAS procedures to get simple descriptive statistics and to carry out a few basic statistical tests, using two data sets: the March data, and the Business data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |