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.3 Language Reference. Concepts
SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
ISBN: 1590478401
EAN: 2147483647
Year: 2004
Pages: 258

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