Sources of Raw Data


Instream Data

The following example uses the INPUT statement to read in instream data:

 data weight;     input PatientID $ Week1 Week8 Week16;     loss=Week1-Week16;     datalines;  2477 195 177 163  2431 220 213 198  2456 173 166 155  2412 135 125 116  ; 

Note: A semicolon appearing alone on the line immediately following the last data line is the convention that is used in this example. However, a PROC statement, DATA statement, or global statement ending in a semicolon on the line immediately following the last data line also submits the previous DATA step.

Instream Data Containing Semicolons

The following example reads in instream data containing semicolons:

 data weight;     input PatientID $ Week1 Week8 Week16;     loss=Week1-Week16;     datalines4;  24;77 195 177 163  24;31 220 213 198  24;56 173 166 155  24;12 135 125 116  ;;;; 

External Files

The following example shows how to read in raw data from an external file using the INFILE and INPUT statements:

 data weight;     infile  file-specification or path-name;  input PatientID $ Week1 Week8 Week16;     loss=Week1-Week16;  run; 

Note: See the SAS documentation for your operating environment for information on how to specify a file with the INFILE statement.




SAS 9.1 Language Reference. Concepts
SAS 9.1 Language Reference Concepts
ISBN: 1590471989
EAN: 2147483647
Year: 2004
Pages: 255

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net