BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

Does anyone know whether SAS store the current setting created by using the MISSING statement?

 

The MISSING statement is different than the MISSING= option.  Then MISSING= option controls how missing values are displayed. You can use the GETOPTION() function to retrieve the current setting.

 

The MISSING statement determines which single letter text strings numeric inputs will treat as representing the corresponding special missing value.  So using:

missing AB ;
input num ;

 Will read "A" and "B" as meaning .A and .B, but treat "C" and "D" as invalid values that generate an error.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

If SAS does not store this somewhere that can be retrieved here is a data step than can create a macro variable with the list.

data _null_;
  missing='_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  do i=1 to 27;
    if .=input(char(missing,i),??1.) then substr(missing,i,1)=' ';
  end;
  call symputx('missing',compress(missing));
run;

Example:

2681   missing azybc;
2682   data _null_;
2683     missing='_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
2684     do i=1 to 27;
2685       if .=input(char(missing,i),??1.) then substr(missing,i,1)=' ';
2686     end;
2687     call symputx('missing',compress(missing));
2688   run;

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


2689
2690   %put &=missing;
MISSING=ABCYZ

View solution in original post

5 REPLIES 5
Tom
Super User Tom
Super User

If SAS does not store this somewhere that can be retrieved here is a data step than can create a macro variable with the list.

data _null_;
  missing='_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  do i=1 to 27;
    if .=input(char(missing,i),??1.) then substr(missing,i,1)=' ';
  end;
  call symputx('missing',compress(missing));
run;

Example:

2681   missing azybc;
2682   data _null_;
2683     missing='_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
2684     do i=1 to 27;
2685       if .=input(char(missing,i),??1.) then substr(missing,i,1)=' ';
2686     end;
2687     call symputx('missing',compress(missing));
2688   run;

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


2689
2690   %put &=missing;
MISSING=ABCYZ
andreas_lds
Jade | Level 19

Interesting, the missing statement "is global in scope" (the docs say so), but it seems that there is no view in sashelp storing the value. For other global statements, like title, filename, ... views exist. Seems as someone forgot to implement this, or i need to look closer.

andreas_lds
Jade | Level 19

@Kurt_Bremser wrote:

IMO, the MISSING statement should be deprecated and replaced by an INMISSING option.


Well, but the "inmissing" option is no in the docs and at with m5 i get

 ERROR 13-12: Unrecognized SAS option name INMISSING.
Kurt_Bremser
Super User

That's why I said an INMISSING option, and not the INMISSING option. Such an option would need to be created. I should have written "replaced by a future INMISSING option" for clarity.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 620 views
  • 0 likes
  • 3 in conversation