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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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