- About CISER Computing
- Computing Resources
- Request a CISER Computing Account
- Computing Node Availability and Usage
- Computing News & User Notes
- HelpDesk Services
- CISER Computing Basics
- CISER Computing FAQ
- CISER Billing FAQ
- Workshop Downloads
- Workshop Schedules & Registration
- Software on the Computing Nodes
- Online Help for Statistical Software
- Buying Statistical Software at Cornell
Reading Colon or Tab Delimited Raw Data Files
Q. My raw data file has colons as delimiters. Can I still read it into SAS? What about tab-delimited files?
A. Yes, just about any delimiter is possible. In SAS, the default delimiter for an input raw data file is space. To specify your own delimiter you can use an INFILE option called DELIMITER= . If needed, you can also use DSD option. When you specify DSD, SAS treats two consecutive delimiters as a missing value and removes quotation marks from character values. Here are some examples of reading a colon delimited and a tab delimited file.
Example to read a colon delimited file:
filename in 'c:\my folder\rawdata.txt'; /* this is your raw data file */
data new;
infile in delimiter=":"; /*
use this for colon-delimiters */
input var1-var20;
run;
Example to read a tab delimited file:
filename two 'c:\my folder\data2.txt'; /* this is your raw data file */
data new2;
infile two DSD delimiter='09'x; /* use hexidecimal code for tab delimiters */
input var1-var10
;
run;