Help using Base SAS procedures

how do get missing value of a order var in the proc report

Reply
Frequent Contributor
Frequent Contributor
Posts: 81

how do get missing value of a order var in the proc report

Hi Dear,
Here is my coding. I am expecting s value of var x and missing value of y in the report. When I run the below codiing , I get value 'a' of x but the value 's' of x. can you please let me if there any options that I can put to get this value in my proc report. I am using SAS 9.2 in Windows XP

data temp;
input @1 x $1. @2 y $1. @3 z 1.;
cards;
ab1
ab2
ac1
ac2
s 3
;
run;
options missing;
proc report data=temp nowd;
column x y z;
define x / order;
define y / order;
define z / analysis;
run;



here is my output;



x y z
a b 1
2
c 1
2

Thanks for your help in advance.


Inp
N/A
Posts: 0

Re: how do get missing value of a order var in the proc report

How about...

proc report data=temp nowd missing;
column x y z;
define x / order;
define y / order;
define z / analysis;
run;
SAS Super FREQ
Posts: 8,743

Re: how do get missing value of a order var in the proc report

Hi:
It seems that you are confusing the SAS System Option MISSING with a different option. Your syntax should be showing you an ERROR message in the SAS log:
[pre]
2944 options missing;
-------
26
ERROR 26-12: Expect an equal sign and value to follow SAS option MISSING.
[/pre]

What SAS means by the error message is that the correct syntax for the option is:
OPTIONS MISSING=' ';

which would replace the normal . (period) for missing numeric values with a blank or space character.

To have PROC REPORT reveal the missing values of GROUP or ORDER variables, you can use the MISSING option either on the PROC REPORT statement or the DEFINE statement:
[pre]
proc report data=.... nowd missing;
OR
define varname / ORDER missing;
[/pre]

The PROC REPORT MISSING option is working with missing GROUP or ORDER variables -- not missing numeric variable values, such as those used for summarizing (which would be affected by the system option).

cynthia
Frequent Contributor
Frequent Contributor
Posts: 81

Re: how do get missing value of a order var in the proc report

thanks a lot Cynthia and Mike,
It helps a lot.

Thank again.

regards

Inp
Ask a Question
Discussion stats
  • 3 replies
  • 186 views
  • 0 likes
  • 3 in conversation