This script executes a DATA step to create the `myLib.smallDataset` table. It uses a `DO` loop to iterate over a list of specific values (missing, -1, 0, 1) stored in the variable `n`. A second variable `m` is derived by applying the `fmtNum.` format (assumed to exist) to `n`. The resulting table is stored in the `myLib` library.
Data Analysis
Type : CREATION_INTERNE
The data is entirely generated within the script via an iterative loop, without reading from an external source.
1 Code Block
DATA STEP Data
Explanation : DATA step that initializes the output table `myLib.smallDataset`. It contains an explicit loop to generate 4 observations with test values for the variable `n` and applies a format conversion to create the variable `m`.
Copied!
data myLib.smallDataset;
do n = ., -1, 0, 1;
m = put(n, fmtNum.);
output;
end;
run;
1
DATA myLib.smallDataset;
2
DO n = ., -1, 0, 1;
3
m = put(n, fmtNum.);
4
OUTPUT;
5
END;
6
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.