SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 33312: Modifying a Data Item Expression in SAS® Information Map Studio to Display Zeros for Missing Numeric Values

DetailsCodeOutputAboutRate It
Overview

By default, each missing numeric value is represented in query results by a single period (.). This sample shows you how to use the PROC SQL CASE statement to define a data item expression that will return a 0 instead of a . for each missing value in the query results.

This sample uses output from SASHELP.SHOES, which has been edited to include missing values for Sales. Specifically, in all of the Regions, boots were discontinued and therefore Sales are now missing for that product.

Click the Full Code tab in this sample for code that generates the modified SHOES table. Click the Output tab in this sample to see the data in the modified table.

Change the Data Item Expression

  1. Open the Expression Editor for the data item. In this sample, the data item is Sales.

    image label

  2. Replace the Expression Text with the new expression. In this sample, the new expression is:
    case when (<MISSINGBOOTS.sales> eq .) then  (<MISSINGBOOTS.sales> eq 0) else (<MISSINGBOOTS.sales>) end
  3. Click OK to save the expression.
  4. Test the query to see the following results. The missing Sales values now display as $0.

    image label

Additional Documentation

For a list of available documentation for SAS Information Map Studio, see http://support.sas.com/documentation/onlinedoc/ims/index.html.

For more information about how SAS handles missing values, see the documentation for Base SAS at http://support.sas.com/documentation/onlinedoc/base/index.html.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.