I get a warning on the second PROC TRANSPOSE to FLOP the data after an initial FLIP.
WARNING: 15 observations omitted due to missing values in the ID variables.
I understand what the warning is about and I also understand that my data is still correct. Can I get rid of this WARNING?
Please don't offer alternative programing methods as that will just obscure the point of this thread. I already know the workaround(s) "I think". I want to talk about the WARNING only.
9 proc sort data=sashelp.class out=_data_;
10 by sex age;
11 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.DATA1 has 19 observations and 5 variables.
Obs Name Sex Age Height Weight
1 Joyce F 11 51.3 50.5
2 Jane F 12 59.8 84.5
3 Louise F 12 56.3 77.0
4 Alice F 13 56.5 84.0
5 Barbara F 13 65.3 98.0
6 Carol F 14 62.8 102.5
7 Judy F 14 64.3 90.0
8 Janet F 15 62.5 112.5
9 Mary F 15 66.5 112.0
10 Thomas M 11 57.5 85.0
11 James M 12 57.3 83.0
12 John M 12 59.0 99.5
13 Robert M 12 64.8 128.0
14 Jeffrey M 13 62.5 84.0
15 Alfred M 14 69.0 112.5
16 Henry M 14 63.5 102.5
17 Ronald M 15 67.0 133.0
18 William M 15 66.5 112.0
19 Philip M 16 72.0 150.0
14 proc transpose;
15 by sex;
16 var weight age;
17 copy name weight age;
18 run;
NOTE: There were 19 observations read from the data set WORK.DATA1.
NOTE: The data set WORK.DATA2 has 19 observations and 15 variables.
Obs Sex Name Weight Age _NAME_ COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10
1 F Joyce 50.5 11 Weight 50.5 84.5 77.0 84 98 102.5 90.0 112.5 112 .
2 F Jane 84.5 12 Age 11.0 12.0 12.0 13 13 14.0 14.0 15.0 15 .
3 F Louise 77.0 12 . . . . . . . . . .
4 F Alice 84.0 13 . . . . . . . . . .
5 F Barbara 98.0 13 . . . . . . . . . .
6 F Carol 102.5 14 . . . . . . . . . .
7 F Judy 90.0 14 . . . . . . . . . .
8 F Janet 112.5 15 . . . . . . . . . .
9 F Mary 112.0 15 . . . . . . . . . .
10 M Thomas 85.0 11 Weight 85.0 83.0 99.5 128 84 112.5 102.5 133.0 112 150
11 M James 83.0 12 Age 11.0 12.0 12.0 12 13 14.0 14.0 15.0 15 16
12 M John 99.5 12 . . . . . . . . . .
13 M Robert 128.0 12 . . . . . . . . . .
14 M Jeffrey 84.0 13 . . . . . . . . . .
15 M Alfred 112.5 14 . . . . . . . . . .
16 M Henry 102.5 14 . . . . . . . . . .
17 M Ronald 133.0 15 . . . . . . . . . .
18 M William 112.0 15 . . . . . . . . . .
19 M Philip 150.0 16 . . . . . . . . . .
21 proc transpose DELIM=_;
22 id _name_ sex;
23 var col:;
24 copy sex name weight age;
25 run;
WARNING: 15 observations omitted due to missing values in the ID variables.
NOTE: There were 19 observations read from the data set WORK.DATA2.
NOTE: The data set WORK.DATA3 has 19 observations and 9 variables.
Obs Sex Name Weight Age _NAME_ Weight_F Age_F Weight_M Age_M
1 F Joyce 50.5 11 COL1 50.5 11 85.0 11
2 F Jane 84.5 12 COL2 84.5 12 83.0 12
3 F Louise 77.0 12 COL3 77.0 12 99.5 12
4 F Alice 84.0 13 COL4 84.0 13 128.0 12
5 F Barbara 98.0 13 COL5 98.0 13 84.0 13
6 F Carol 102.5 14 COL6 102.5 14 112.5 14
7 F Judy 90.0 14 COL7 90.0 14 102.5 14
8 F Janet 112.5 15 COL8 112.5 15 133.0 15
9 F Mary 112.0 15 COL9 112.0 15 112.0 15
10 M Thomas 85.0 11 COL10 . . 150.0 16
11 M James 83.0 12 . . . .
12 M John 99.5 12 . . . .
13 M Robert 128.0 12 . . . .
14 M Jeffrey 84.0 13 . . . .
15 M Alfred 112.5 14 . . . .
16 M Henry 102.5 14 . . . .
17 M Ronald 133.0 15 . . . .
18 M William 112.0 15 . . . .
19 M Philip 150.0 16 . . . .
SAS does not provide a good facility for suppression of warning messages, unlike notes and errors there does not appear to be a good method for exclusion of these types of log information:
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.