【发布时间】:2023-02-06 22:34:43
【问题描述】:
我的代码有什么问题?
69 data train2.sacked;
70 train2.payrise;
71 set train2.exam (drop = test1 test2 test3 test4);
72 mean2 = mean(test1, test2, test3, test4);
73 if mean2 > 5 then
74 do
75 result = 'PASS'
76 action = 'Pay rise'
77 output payrise;
78
79 if mean2 <= 5 then
80 do
81 result = 'LOSER'
82 action = 'SACKED'
83 output sacked;
84
85 else do
86 result = 'What have I done?'
87 action = 'PARTY'
88 output aahhhhh;
89 length lname fname $ 40 result $ 20;
90 run;
我尝试运行代码,但它给了我错误。
ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase.
ERROR 557-185: Variable train2 is not an object.
【问题讨论】:
-
第一个问题是您似乎没有以必需的分号 (
;) 结束每个语句。错误可能是由您未显示的数据语句之前的代码引起的,并且解析器由于格式错误的语句而将事物混在一起。
标签: if-statement variables sas output datastep