Caution: Default record length

The default record length for input and output raw ASCII files is 256 characters. If the input statement is identifying variables beyond the 256th column, SAS goes to the next line for the additional characters.

To solve this problem, identify the record length on the infile and/or file statement. In this example, both the input and output files are identified as being 500 columns wide.

***********************************************************************
data test;
infile '/usr/shared/test.dat' lrecl=500;
input sex 3-3  age 201-202  income 495-500;
file out lrecl=500;
put sex 3-3  age 201-202  income 495-500;
end;

It does not hurt if you specify an LRECL larger than your actual record length.


NEW PSC blog

Recent resources, events, news

New Publications

Knodel et al. "Gendered Housework in Vietnam." PSC Research Report.

Couper. Designing Effective Web Surveys

Next Brown Bag

Monday, Oct 13
Jamie Jones
"Fertility & Risk Aversion on Utah Frontier"


W A R N I N G

If you are reading this, it may be that you are using rather old web browsing software that does not support modern international Web technology standards. For a better experience of the Web and this site in particular, please upgrade your web browser software today. The following are good choices: Firefox 2; Opera 9; Safari 3.