SAS Infile Statement
The infile statement replaces the cards statement when data is to be read from a file already on disk.
The infile statement MUST appear BEFORE the input statement that reads data from the file. The simple form of the statement is
infile 'c:\datafile\mydata.dat'; 公卫家园
The filename is the full name of a file on the computer system including the path and extension. In a DOS or Windows session, this would be of the form given above while on a UNIX platform the form would be '/datafiles/mydata.dat'.
The associated input statement should process the data in the file as usual.
Instead of specifying the filename directly, a SAS fileref can be used.
Two options are available with the infile statement. Example:
infile 'c:\datafile\mydata.dat' missover linesize=100;
The missover option is used to assign the missing value symbol to variables not given a value in a data line, and the linesize option changes the length of each line read from the data file from the default value of 80.
The infile statement can be used in place of the cards statement by using the special filename cards. The syntax is:
infile cards missover linesize=100;
This allows the missover and linesize options to be used when the raw data is given in the program editor window.
The infile statement MUST appear BEFORE the input statement that reads data from the file. The simple form of the statement is
infile 'c:\datafile\mydata.dat'; 公卫家园
The filename is the full name of a file on the computer system including the path and extension. In a DOS or Windows session, this would be of the form given above while on a UNIX platform the form would be '/datafiles/mydata.dat'.
The associated input statement should process the data in the file as usual.
公卫家园
Instead of specifying the filename directly, a SAS fileref can be used.
Two options are available with the infile statement. Example:
infile 'c:\datafile\mydata.dat' missover linesize=100;
The missover option is used to assign the missing value symbol to variables not given a value in a data line, and the linesize option changes the length of each line read from the data file from the default value of 80.
公卫人
The infile statement can be used in place of the cards statement by using the special filename cards. The syntax is:
infile cards missover linesize=100;
This allows the missover and linesize options to be used when the raw data is given in the program editor window.
公卫考场
附件列表
词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。
如果您认为本词条还有待完善,请 编辑
上一篇 SAS Informats 下一篇 SAS IF, IF-THEN and IF-THEN-ELSE Statements