what's wrong with my code?
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;
I try running the code but it gives me the error.
ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase.
ERROR 557-185: Variable train2 is not an object.
The error is from the second statement.
SAS thinks you are trying to reference a method of an object named TRAIN2 but the data step has not defined such an object (an example of an object in a data step is a HASH). I suspect that you meant that to be a dataset to include on the DATA statement but there is an extra semicolon in the middle of the DATA statement.
The rest of your program also has a lot of errors.