BookmarkSubscribeRSS Feed
Hillel_Morris
Calcite | Level 5

Good afternoon all.

 

I believe I have done this in the past but can't remember how.

 

In a proc report, can I place an N/A in a cell if the value isn't possible,

 

For example I have a report like this:

                     Brown       White     Green

Dog               3               2            0

Turtle            2                0            2 

 

Since there is no such thing as a Green Dog or a White Turtle, I want to put the term 'N/A' into those cells, like so:

                     Brown       White     Green

Dog               3               2            N/A

Turtle            2                N/A        2 

 

Is this possible?

 

Thanks.

 

- Hillel

                  

 

 

2 REPLIES 2
collinelliot
Barite | Level 11

You can use a user-defined format:

 

proc format;
value myFmt
0 = 'N/A'
OTHER=[8.]; <-- Or whatever format you want.
run;

Then just use this format for the variable you're displaying.

 

If it's missing and not zero, set missing to 'N/A' in the format.

Reeza
Super User

Have you considered a custom format where . is set to NA.  I personally wouldn't use 0, because you could 0 red dogs but it's possible they exist (Clifford the Big Red Dog probably doesn't count though).

proc format;
value miss_na_fmt
. = 'N/A'
other = [best12.];
run;;

 

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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