The data is created directly within the SAS script via the CARDS statement in a DATA step. It is therefore an internal data source to the program.
1 Code Block
DATA STEP Data
Explanation : This block uses a DATA step to create a temporary dataset named 'instream_mtcars'. The variables 'cars' (character), 'mpg', 'cyl', 'disp', 'hp', 'drat' (numeric) are defined. The CARDS statement indicates that the following data lines until a semicolon (;) is encountered are the data to be read and inserted into the dataset. This data represents two car models with their corresponding attributes.
Copied!
data instream_mtcars;
input cars$ mpg cyl disp hp drat;
cards; /*cards user to insert instream data*/
Mercedes_AMG 21 6 160 110 3.9
BMW_X1_AUTO 22.8 4 108 93 3.85
;
run;
1
DATA instream_mtcars;
2
INPUT cars$ mpg cyl disp hp drat;
3
CARDS; /*cards user to insert instream data*/
4
Mercedes_AMG 2161601103.9
5
BMW_X1_AUTO 22.84108933.85
6
;
7
RUN;
2 Code Block
PROC PRINT
Explanation : This block uses PROC PRINT to display the content of the 'instream_mtcars' dataset. The 'data=instream_mtcars' option specifies the dataset to be printed. By default, PROC PRINT displays all observations and all variables of the dataset in the output window.
Copied!
proc print data=instream_mtcars;
run;
1
PROC PRINTDATA=instream_mtcars;
2
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.