[英]what is difference between datalines and cards statement
I am seeking job on SAS tool. 我正在寻找SAS工具方面的工作。 interviewer asked me this question I said no difference, both are used to read internal data but he told there is a difference between cards and datalines statement .
面试官问我这个问题,我说没有区别,两者都是用来读取内部数据的,但是他告诉卡和数据线声明之间有区别。
kindly help me to crack this question. 请帮助我解决这个问题。
There is no significant difference between the two. 两者之间没有显着差异。
CARDS
is defined as an alias of DATALINES
, and by definition an alias should have identical behavior to the statement it is an alias of. CARDS
被定义为DATALINES
的别名 ,并且根据定义,别名应具有与其作为别名的语句相同的行为。
There is an insignificant difference, which is really simply an undefined behavior; 差别不大,实际上只是一种未定义的行为。 it is explained on page 4 of Andrew Kuligowski's 2007 paper , and related to how
cards
and datalines
have slightly different results when used in a file
statement (which they are not intended to be used with). 它在Andrew Kuligowski的2007年论文的第4页上进行了解释,并与
cards
和datalines
在file
语句中使用时(它们不打算使用)的结果略有不同有关。 The behavior is slightly different now for datalines
in modern SAS (9.4); 现在,现代SAS中的
datalines
的行为略有不同(9.4); it gives an error, but a different one from cards
. 它给出了一个错误,但与
cards
不同。 However, it is simply undefined behavior; 但是,这只是未定义的行为。 it would be an absurd thing for an interviewer to expect as an answer.
面试官期望得到答案是荒谬的。
Your interviewer may have been referring to datalines
versus datalines4
, or cards
versus cards4
; 您的面试官可能是指
datalines
与datalines4
,或cards
与cards
cards4
; those are different, because the latter requires four ;
它们是不同的,因为后者需要四个
;
to end instead of one (to allow for the possibility of a semicolon in the data itself). 结束而不是结束(以允许在数据本身中使用分号)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.