![how to download sas data sets how to download sas data sets](https://0.academia-photos.com/attachment_thumbnails/42633848/mini_magick20190217-8886-15ozvqc.png)
Suppose we want to create a new dataset with a variable BMI computed from the existing variables height and weight.
![how to download sas data sets how to download sas data sets](https://sascrunch.com/wp-content/uploads/2020/12/data_sets_1024.png)
Conversely, if you only want to keep a couple of variables in the dataset then using a KEEP option would be easier than specifying all the variables to remove in a DROP option. If you only want to remove a couple of variables from a dataset, then using a DROP option would be easier than specifying all the variables to stay in a KEEP option.
![how to download sas data sets how to download sas data sets](https://www.cdata.com/ui/img/logo-sasdatasets.png)
These two options can accomplish the same thing, but in a given situation one will likely be easier than another.
#How to download sas data sets code#
You might use code like this when you want to copy a dataset from the temporary library to a permanent library or vice versa. For example, the program DATA new_sample Ĭreates a new temporary dataset called new_sample that is a clone of the already existing dataset called sample. (It is strongly recommended that you do not alter your original data files.) Copying or cloning an existing datasetĪ data step containing only the SET statement will create an exact copy of the dataset. This allows you to create new variables or recode existing variables without permanently changing the original data. The statements above tell SAS to create a new dataset ( New-Dataset-Name) that is an exact copy of an existing SAS dataset ( Existing-Dataset-Name). In general the code will follow this form: DATA New-Dataset-Name (OPTIONS) When you need to copy or modify an existing dataset, use the SET statement in the data step.