|
hi ... just to add one comment to what's been posted so far ...
data steps comprise two types of statements ... declarative and executable
the declarative statements take place at compile time
the executable statements take place at execution time
your statement ... if column=. then drop;
mixes two types of statements ... not allowed !!!
IF-THEN is EXECUTBLE
DROP is DECLARATIVE
take a look at ... DATA Step Statements: Executable and Declarative Statements
http://tinyurl.com/data-step-statements
as for what you are really trying to do, as has been pointed out, if you want to get rid
of an observation (ROW) at execution time, that's easy ... IF-THEN-DELETE (all executable)
if you want to get rid of a variable (COLUMN) if any values of that variable are missing, that's
more difficult ... you'll have to read/write the entire data set based on finding a missing value
one possible way ... replace your 'IF-THEN-DROP' with the 'IF-THEN-DO' shown below
data test;
input x y @@;
datalines;
1 2 3 . 5 6 7 8 9 10
;
run;
data _null_;
set test;
if y eq . then do;
call execute ('data test; set test (drop=y); run;');
stop;
end;
run;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> i am trying to do something such as
>
> data new;
> set old;
> if column=. then drop;
> run;
>
> this does not work, but translates the basic concept of my goal.
> any help would be great.
> thanks
>
>
|