公卫百科  > 所属分类  >  SAS   
[0] 评论[0] 编辑

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.

公卫家园



附件列表


0

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

如果您认为本词条还有待完善,请 编辑

上一篇 SAS Informats    下一篇 SAS IF, IF-THEN and IF-THEN-ELSE Statements

标签

暂无标签

同义词

暂无同义词