|
板凳

楼主 |
发表于 2012-1-6 05:00:57
|
只看该作者
Re: 求助:手工建立一个数据集时遇到的问题 - 数据集的转置?
[quote="jingju11":27upb1b7][code:27upb1b7]proc iml;
use work.had;
read all var _all_ into have0;
close work.had;
tHave0 =have0`;
have1 =tHave0[2:nrow(tHave0), ];
names =tHave0[1, ];
create work.have2 from have1[colname =names];
append from have1;
close have2;
quit;[/code:27upb1b7]
Hopefully it works.
Jingju[/quote:27upb1b7]
Thank you so much jingju11! Thank you for your time and warmhearted help!
This is a very advanced solution for me, I don't quite understand it actually. But I tried your code and there was an error message.
2 proc iml;
NOTE: IML Ready
3 use my.jan4_8cases;
4 read all var _all_ into have0;
5 close my.jan4_8cases;
6 tHave0 =have0`;
7 have1 =tHave0[2:nrow(tHave0), ];
8 names =tHave0[1, ];
9 create work.have2 from have1[colname =names];
ERROR: Operand requires character value.
statement : CREATE at line 9 column 3
10 append from have1;
ERROR: No data set is currently open for output.
statement : APPEND at line 10 column 3
11 close have2;
NOTE: Cannot close WORK.HAVE2; it is not open.
12 quit;
NOTE: Exiting IML.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IML used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds |
|