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

Hello

 

When I coding, I have problem.

 

I load excel file in sas.

 

When I load excel file, the data set present period (.) in blank cell.

 

But I want to remove this period.

 

How can I remove period in numeric format??

 

Please, Help me. Everyone~~

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

The period is essential when working with SAS, as it is the displayed character for missing numerical values. All SAS programmers expect missing values to be displayed as a dot, if no special option is set.

That option is

options missing = ' ';

See this example code:

data have;
input x1;
cards;
1
2
.
;
run;

proc print data=have;
run;

options missing = ' ';

proc print data=have;
run;

Result:

Beob.    x1

  1       1
  2       2
  3        
            

Beob.    x1

  1       1
  2       2
  3        

 

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

The period is essential when working with SAS, as it is the displayed character for missing numerical values. All SAS programmers expect missing values to be displayed as a dot, if no special option is set.

That option is

options missing = ' ';

See this example code:

data have;
input x1;
cards;
1
2
.
;
run;

proc print data=have;
run;

options missing = ' ';

proc print data=have;
run;

Result:

Beob.    x1

  1       1
  2       2
  3        
            

Beob.    x1

  1       1
  2       2
  3        

 

PeterClemmensen
Tourmaline | Level 20

Remember that the . is SASs representation of a missing numeric value. However, you can do something like this

 


options missing='';

data test;
var=1;output; /* Non missing value */
var=.;output; /* Missing value     */
run;

proc print data=test;
run;
ballardw
Super User

Or use a custom format to displayed desired text instead:

proc format library=work;
value m
. = 'Missing'
;
run;

data test;
var=1;output; /* Non missing value */
var=.;output; /* Missing value     */
run;

proc print data=test;
   format var m.;
run;

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
  • 3 replies
  • 5234 views
  • 1 like
  • 4 in conversation