BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
K_S
Quartz | Level 8 K_S
Quartz | Level 8

Hello everyone,

I am trying to create formats using proc format but for whatever reason the missing values are not getting formatted.

Same problem for both numeric and character vars.

Any idea why?

1 ACCEPTED SOLUTION

Accepted Solutions
unison
Lapis Lazuli | Level 10
PROC FORMAT;
VALUE AREA (NOTSORTED)
1="URBAN: built-up area with a high population density"
2="RESIDENTIAL: living dwellings"
.="MISSING/UNKNOWN"
other="some other value";
RUN;

Could be that your missing values are not . but rather some other missing such as .Z or ._

-unison

View solution in original post

10 REPLIES 10
PaigeMiller
Diamond | Level 26
Show us the code. Show us a portion of the data.
--
Paige Miller
K_S
Quartz | Level 8 K_S
Quartz | Level 8

PROC FORMAT;
VALUE AREA (NOTSORTED)
1="URBAN: built-up area with a high population density"
2="RESIDENTIAL: living dwellings"
.="MISSING/UNKNOWN";
RUN;

 

 

PaigeMiller
Diamond | Level 26
Hi. I requested you show us two things. You only showed us one.

Also show us the rest of the code where you assign the format to a variable.
--
Paige Miller
K_S
Quartz | Level 8 K_S
Quartz | Level 8

data X;
set Y;
FORMAT
AREA AREA.;
RUN;

 

and please note, the other values get formatted, but not the missing ones.

unison
Lapis Lazuli | Level 10
PROC FORMAT;
VALUE AREA (NOTSORTED)
1="URBAN: built-up area with a high population density"
2="RESIDENTIAL: living dwellings"
.="MISSING/UNKNOWN"
other="some other value";
RUN;

Could be that your missing values are not . but rather some other missing such as .Z or ._

-unison
K_S
Quartz | Level 8 K_S
Quartz | Level 8

Sadly, that is not the case. Any other possible explanation.

unison
Lapis Lazuli | Level 10

 

data have;
	input area;
	datalines;
1
2
.
.
;
run;

proc format;
	value area 
		1='URBAN: built-up area with a high population density' 
		2='RESIDENTIAL: living dwellings'
		.='MISSING/UNKNOWN';
run;

data want;
	set have;
	format area area.;
run;
proc print noobs;
run;

This works just fine. Can't really know for sure what's going on without data/images/etc.

 

Best,

 

 

-unison
K_S
Quartz | Level 8 K_S
Quartz | Level 8
I see what you mean now! How would i be able to find out what the missing value is? I am looking at my table and see dots.
jimbarbour
Meteorite | Level 14
Can you post your proc format code, your data, and your results? Otherwise I think I'd kind of be taking a shot in the dark.

Jim
K_S
Quartz | Level 8 K_S
Quartz | Level 8

I have posted the syntax in response to someone else's comment. I will not be posting the data.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 10 replies
  • 3133 views
  • 0 likes
  • 4 in conversation