Reading Instream Data

Overview

Reading instream data is extremely helpful if you want to create data and test your programming statements on a few observations that you can specify according to your needs.
To read instream data lines that you enter directly in your SAS program, rather than data that is stored in an external file:
  • Insert a DATALINES statement as the last statement in the DATA step and immediately preceding the data lines.
  • Insert a null statement (a single semicolon) to indicate the end of the input data.
data sasuser.stress; 
   input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 
         RecHR 35-37 TimeMin 39-40 TimeSec 42-43 
         Tolerance $ 45; 
   datalines; 2458 Murray, W 72 185 128 12 38 D 2462 Almers, C 68 171 133 10 5 I ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.