You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行如下SAS代码后,Willis数据集包含多少列?

How Many Columns Will the SAS Dataset Willis Contain?

Let's break down this SAS data step line by line to figure out the final column count for the Willis dataset:

First, the short answer: the Willis dataset will have 4 columns: b, A, j, and lev.

Here's why each variable makes the cut:

  • b: This is the index variable for the outer do loop (do b = 1 to 12;). In SAS, loop index variables are automatically included in the output dataset unless you explicitly drop them—no extra code needed to keep them around.
  • A: Assigned in line 34 with A = rand("normal", 12.5, 1.57);. Any variable that gets a value assigned in the data step (and isn't a temporary variable) becomes a column in the resulting dataset.
  • j: The index variable for the inner do loop (do j = 1 to 5;). Same rule applies here as with b—loop indexes stick around in the dataset by default.
  • lev: Calculated in line 36 with lev = rand("normal", 4, 2.155) + A; and written out with the output; statement. This variable is explicitly generated for the output, so it's definitely included.

A quick note on what doesn't count: The put statements (lines 32 and 40) only print text and variable values to the SAS log—they don't add any columns to the dataset itself.

内容的提问来源于stack exchange,提问作者Jeremy Wik

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:49:15