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

More census/citizenship articles

Deja vu: Citizenship question or not?

Data Visualization: Intro with Data

Data & Tools to study Global Inequality

Archiving Social Media Data

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: