Reputation: 71
i am getting a log warning stating WARNING: 21 observations omitted due to missing ID values i was transposing the dataset using this code:
PROC TRANSPOSE DATA= PT OUT= PT;
BY SOC_NM PT_NM;
ID TREATMENT;
VAR COUNT;
RUN;
i want to remove this warning from log.is there any option available in SAS for this
thank you for help.
Upvotes: 1
Views: 6727
Reputation: 11
Before transposing, add this condition in the data step
if TREATMENT=. then TREATMENT=99;
after transposing, drop the variable "_99"
Upvotes: 1
Reputation: 7602
There's no option to remove warning messages from the log. If you really must keep your code as is then you can use PROC PRINTTO to temporarily divert the log output to an external file. However, this means you won't see anything in the log for that particular step, so it is not something I would recommend unless you are very sure of what you are doing. Check out the example code below, you'll see that only the steps creating tables a and c show in the log.
data a;
run;
proc printto log='c:\temp\temp.log';
run;
data b;
run;
proc printto;
run;
data c;
run;
Upvotes: 0
Reputation: 63424
You need to decide whether you are keeping the TREATMENT=' '
records or not. If you want to keep them, then you need to assign a nonmissing value to TREATMENT
. If not, then the WHERE statement like vasja's answer will work.
Upvotes: 2
Reputation: 4792
Will adding WHERE clause do the job for you?
PROC TRANSPOSE DATA= PT OUT= PT;
BY SOC_NM PT_NM;
ID TREATMENT;
VAR COUNT;
WHERE NOT MISSING(TREATMENT);
RUN;
Upvotes: 2