Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
创建具有可变属性数的SAS数据集_Sas - Fatal编程技术网

创建具有可变属性数的SAS数据集

创建具有可变属性数的SAS数据集,sas,Sas,我需要在SAS中创建一个数据集,其中包含一个属性名变量。 我不太精通SAS,所以用普通语言写逻辑 for(i=1 to 10) { for (j=1 to n) { Combinations(j,i); } //perform some calculations on the temporary average table and delete it } 问题在于组合函数。在这里 组合(i,j) { //找到所有可能的组合 //求所有组合的平均值 } 我现在需

我需要在SAS中创建一个数据集,其中包含一个属性名变量。 我不太精通SAS,所以用普通语言写逻辑

for(i=1 to 10)
{
   for (j=1 to n)
   {
      Combinations(j,i);
   }
  //perform some calculations on the temporary average table and delete it
}
问题在于组合函数。在这里 组合(i,j) { //找到所有可能的组合 //求所有组合的平均值 }

我现在需要将所有平均值存储在一个临时表/数据集中

例如,对于i=2,j=5。。对于j的每一个值,我有十个组合。 因此,列计数将为10,行计数将为2

我想这个表应该是一个动态数据集。 我真的不知道该怎么办。。刚刚击中

任何帮助都将不胜感激


感谢

最好的解决方案可能是最初将i,j数据集创建为垂直数据集(每个最终变量为一行),然后使用
PROC TRANSPOSE
将其转换为水平数据集。您可以使用
ID
语句来命名变量。

听起来不错。。但每次我们换位。。它将创建一个新表。我只需要在每次迭代后创建一次并插入行。一次生成所有行,然后转置一次。可能吗?我是说。。假设表中有像d1 12 d1 13 d1 14 d2 11 d2 12 d2 56 d3 1 d3 2 d3 3这样的行,有可能生成一个看起来像
12 13 14
11 12 56
12 3
的转置表吗