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

SAS Input Statement

The input statement is used in the datastep to read raw data from data cards and assign the data as values of SAS variables.

The most basic type of input statement is list input. Here the variables are simply listed in the order in which they are to be read from the data cards. Example:

公卫百科




data second;
input name $ age income;
....


The trailing $ denotes the fact that name is to be a character variable, while age and income are numeric variables.

NOTE: The value of a character variable read using this simple input statement will be truncated to a length of 8 characters and can contain no embedded blanks. This restriction on character variables can be overcome by using a formatting description called a SAS informat. 公卫家园

As SAS reads raw data from a data card an internal SAS pointer moves along the card and points to the next position from which data will be read. For list input, the pointer moves until reaching the next non-space (non-blank) character.

Placing the @ or @@ at the END of an input statement holds the column pointer in position for the correct processing of data cards in which multiple or incomplete records appear on each card. 公卫人

附件列表


0

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

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

上一篇 SAS Keep Statement    下一篇 SAS Informats

标签

暂无标签

同义词

暂无同义词