Home > Data Services > Catalog . Restricted Data . Census . ACS

Search Data Services

Meta Search
search across all the following databases:

Data Catalog
Data and documentation

Common questions and answers.

Entire collection of data resources.

Latest Data News

RSS Feed icon

U.S. Population Migration Data

U.S. Department of Education Releases College Scorecard Data

Big changes coming to IRBs . . . . still time to comment

Will this be an election issue in the US?

U.S. and World Population Clock Has Been Updated with New Features

Data Services Knowledge Base


I am having trouble reading a file into SAS. SAS is complaining about the last variable in each record. If I look at it with an editor, it looks like a ^M.


You are using a file created in a DOS/Windows environment on unix. Unix files end in a line feed and files created in DOS end in a carriage return/line feed. There are several ways to get rid of this extra character:

Your unix operating system may have several utilities on it that take care of this, dos2unix and unix2dos.

Assume that the file created in the DOS/Windows environment is called file_w and the file you want to create for analysis using unix will be called file_u.

dos2unix file_w file_u

unix2dos does the opposite. It takes a file created in unix and adds a carriage return/line feed:

unix2dos file_u file_w

If your system does not have these utilities, the following command in unix is the equivalent of dos2unix:

tr -d '\015' < file_w >  file_u

Related Question Groups: