选项应该在的位置有一个数据文件。它在做什么?

There is a datafile where the Options should be. What is it doing?

我正在努力学习 SAS,很明显。我遇到了一种奇怪的格式,但我还没有通过 google 找到对它的解释。 datafile1 在下面的语句中做了什么?那里不应该有选项吗?

data dataset1 datafile1; 
length col1 col2 .;
set c;
run; 

datafile1 是第二个输出数据集。您在问题中列出的数据步骤只是生成两个相同的输出数据集,这通常是无趣的 - 但您可以这样做:

data male female all;
  set sashelp.class;
  if sex eq 'F' then output female;
  else if sex eq 'M' then output male;
  output all;
run;

将不同的行输出到不同的数据集。

数据集选项如下:

data want (keep=name age);
  set sashelp.class;
run;

它们兼容 - 你可以做到

data male(keep=name age) female(keep=name age) all(keep=name age sex);
  set sashelp.class;
  if sex eq 'F' then output female;
  else if sex eq 'M' then output male;
  output all;
run;