1

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.

Robert Penridge
  • 8,424
  • 2
  • 34
  • 55
ved_null_
  • 71
  • 2
  • 10
  • 1
    Also - it's a very bad idea to use the same dataset for both the input and output destination. Running the code will work the first time, but running it a second time will have completely different results as the input dataset is completely different. – Robert Penridge Feb 27 '15 at 18:01

4 Answers4

2

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;
vasja
  • 4,732
  • 13
  • 15
2

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.

Joe
  • 62,789
  • 6
  • 49
  • 67
1

Before transposing, add this condition in the data step

if TREATMENT=. then TREATMENT=99;

after transposing, drop the variable "_99"

Gerard de Visser
  • 7,590
  • 9
  • 50
  • 58
sukumar
  • 11
  • 1
0

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;
Longfish
  • 7,582
  • 13
  • 19