我正在尝试对我在 SAS 中创建的数据集进行排序,但现在即使我删除了排序功能,我的代码也没有 运行,有人可以帮助我吗?

I'm trying to sort my created data set in SAS, but now even when I remove the sorting function, my code does not run, can someone help me?

这是我的代码

data cities.admit;
length city state population ;
length zipcode ;
input city $ state $ zipcode $ population $;
cards;
Jacksonville Florida 32034 949611
Miami Florida 33101 442241
Tampa Florida 33601 384959
Orlanda Florida 32789 307573
Hialeah Florida 33002 223109
Henderson Nevada 89002 317610
Reno Nevada 89433 264165
Enterprise Nevada 89113 221831
Paradise Nevada 89074 191238
Sparks Nevada 89431 108445
Philadelphia Pennsylvania 19019 1584981
Pittsburgh Pennsylvania 15106 302407
Allentown Pennsylvania 18001 123328
Erie Pennsylvania 16501 97369
Reading Pennsylvania 19601 89872
;

proc print;
var city state zipcode population;
title 'CityInformation - Homework 1';
run;

proc sort data=cities.admit out=sortedOutput;
key population / descending;
run;

BY 语句与许多 SAS 过程一起使用,将其包含在 PROC SORT 步骤中至关重要,因为这是您告诉 PROC SORT 要根据哪些变量进行排序的方式。

我想您可能想对数据进行排序,使人口值最大的城市排在最前面。 DESCENDING 关键字放在它适用的变量之前。

proc sort data=cities.admit out=sortedOutput;
  by descending population;
run;