SAS中文论坛

标题: Can sas read *.txt document ? [打印本页]

作者: shiyiming    时间: 2004-5-3 20:29
标题: Can sas read *.txt document ?
Can sas read *.txt document ?
作者: shiyiming    时间: 2004-5-4 01:33
Yes, SAS can do it.  Please take a reference to FILENAME, INFILE and INPUT statements.
作者: shiyiming    时间: 2004-5-6 18:40
SAS does read .txt files. However, from my experience, when you are using INFILE and INPUT statements to read in the data from a .txt file, you will be having great difficulty if the file contains variable names.

First of all, SAS is not expecting to column names in a text file. So you will have to open .txt in another package (eg. wordpad, word) delete the row with the variable names and save this file.
Second, you will need to specify the directory of where the file is located.

There are several different ways that you can read a dataset into SAS. Normally, I prefer using PROC IMPORT command, because it specifies the variable names and missing data.

Cheers
作者: shiyiming    时间: 2004-5-6 21:16
标题: Thanks so much for your help.
Thanks so much for your help.
作者: shiyiming    时间: 2004-5-14 13:22
if you use "firstobs=2",you don't need edit data.

[quote="Trinity":1566d]SAS does read .txt files. However, from my experience, when you are using INFILE and INPUT statements to read in the data from a .txt file, you will be having great difficulty if the file contains variable names.

First of all, SAS is not expecting to column names in a text file. So you will have to open .txt in another package (eg. wordpad, word) delete the row with the variable names and save this file.
Second, you will need to specify the directory of where the file is located.

There are several different ways that you can read a dataset into SAS. Normally, I prefer using PROC IMPORT command, because it specifies the variable names and missing data.

Cheers[/quote:1566d]




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2