The default length of the variable created by INDSNAME is 41. It contains a two-level name – SASHELP.CARS. The dataset name is created in a temporary variable dataset. With the INDSNAME option in the set statement in SAS, you can store the name of datasets from which the current observation is read. If any student has a score value of less than 40, we need to print the previous observation and the next observation.Īn array can be used to flag an observation once it has been used. Set datasets.class point=point nobs=noobs ĬNT will determine the range of values for the POINT variable. Set datasets.class(keep=name score rename=(name=name1)) data class2(keep=name score semester cnt pt) In the following example, we need to extract the student names who have scored less than 40 along with the previous semester and the next semester. The POINT= and NOBS= options can also be helpful when performing a look-ahead or look-back of the data. To read more observations from the input data set, the POINT= option can be combined with a DO loop as in the below example. In the above example, the POINT= option tells SAS to read only the 5th observation from the input dataset. You can download the example programs and the datasets from the link provided at the end of this article. The POINT= and NOBS-= are used together, which returns the number of observations in the dataset. Since the POINT = option provides direct access to SAS data sets, it can not be used with a BY statement or the WHERE= dataset option. The variable used for the POINT variable is a temporary variable and not added to the final dataset. For example, if you have to read only the 5th observation from a dataset. The POINT option allows direct access to the specified number of observations. The POINT= option tells SAS which observation to read next. Using the POINT= option, you can perform a non-sequential read. The SET statement in SAS reads values in a sequential manner. UNIQUE = It is used with the KEY= option to read from the top of the index.POINT = Specifies a temporary variable whose value determines which observation is read.NOBS= Creates a temporary variable containing the total number of observations of the input dataset.CUROBS= It creates and names a variable which contains the current observation number.INSDNAME = It is used to identify the current data source.KEY = It specifies an index to be used when reading SAS datasets.END = It is used to detect the last observation from an incoming dataset.DATA Step with Two or more SET Statements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |