BookmarkSubscribeRSS Feed
mcook
Quartz | Level 8

In proc report, how do i get the '.'  value to be displayed as 'unknown', rather than the missing indicator (see table below).  For character variables i could simply change all missing values to 'unknown' in the dataset, but i cannot do that with numerical vars.  

 

mcook_0-1714606895159.png

 

2 REPLIES 2
A_Kh
Barite | Level 11

Hi, 

Use PROC FORMAT before proc report, then apply created format in proc report to display  the missing value as 'unknown'.

Patrick
Opal | Level 21

If you're already using a SAS supplied format like percent. below sample code to demonstrate how you can extend it for a missing case.

proc format;
  value missToUnknown
    . = 'Unknown'
    other=[percent.]
    ;
run;

data demo;
  do var=-0.5,.,0,0.5;
    output;
  end;
run;

proc print data=demo;
  format var missToUnknown.;
run;

Patrick_0-1714627126174.png

 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 803 views
  • 0 likes
  • 3 in conversation