The script starts with a DATA step named 'prob12_2'. It reads raw data included via the DATALINES statement with the DSD option to handle delimiters. Specific informats are applied to correctly read dates (DOB and VD). Then, the PRINT procedure is used to list the content of the created dataset, with a specified title.
Data Analysis
Type : CREATION_INTERNE
Data is defined directly in the script using the DATALINES statement.
1 Code Block
DATA STEP Data
Explanation : Creation of the 'prob12_2' table. Reading instream data with handling of date formats (mmddyy10. and date9.) and character variables.
Copied!
data prob12_2;
infile datalines dsd;
informat DOB mmddyy10. VD date9. GENDER $1. NAME $11.;
input DOB VD GENDER NAME;
format DOB VD mmddyy10.;
datalines;
10/21/1950,03MAY2004,M,Schneider
11/12/1944,05DEC2004,F,Strawderman
01/01/1960,25APR2004,M,Smith
;
1
DATA prob12_2;
2
INFILEDATALINES dsd;
3
informat DOB mmddyy10. VD date9. GENDER $1. NAME $11.;
4
INPUT DOB VD GENDER NAME;
5
FORMAT DOB VD mmddyy10.;
6
7
DATALINES;
8
10/21/1950,03MAY2004,M,Schneider
9
11/12/1944,05DEC2004,F,Strawderman
10
01/01/1960,25APR2004,M,Smith
11
;
2 Code Block
PROC PRINT
Explanation : Display of the previously created 'prob12_2' table.
Copied!
proc print;
title 'Problem 12.2';
run;
1
PROC PRINT;
2
title 'Problem 12.2';
3
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.