SAS Info Map: Need leading zeros on the account number?
When creating new variables, the SAS Information Map Studio opens the entire SAS format library to you. These formats can be key to creating lots of new data items. SAS format control the way data items appear. In past articles I showed you how to create new data item using SAS functions and date formats. Check the SAS documentation to learn more about all the different formats available.
Creating new Data Items in SAS Information Map Studio
When data has been merged from various companies, such as when one company acquires another one, their data may be in different formats. For instance, account numbers might vary from 8 characters in one company and 12 characters wide in the other. When this occurs one option is to use the widest account number and add zeros to the front of the smaller one to integrate the fields better. You can do this easily within the information map using the Z format.
From SAS Information Map Studio, you can create or modify the existing variable. In this case I have two account numbers – 1 where there are only 3 characters and the other with 5 characters. The end result should be a 6 character long account number where the 0 are used to complete the blanks.
- Create or modify the data item. In the Classifications, Aggregations, and Formats pane, select the Numeric format type and then navigate to the Z format.
- Adjust the total width of the field. This value should match the width of the account number after the zeros have been added. In this example, the value is set to 6.
- For the result you can see that the zeros complete the field. Australia account numbers have a default value of 5 so 1 zero was added, while Austria has a default value of 3, so 3 zeros were added.
Learn all about SAS BI
You can learn more about SAS Business Intelligence from the "SAS BI Bible." Take a peek inside the Building Business Intelligience with SAS book.
Latest posts by Tricia Aanderud (see all)
- Designing Dashboards: Sending Your Style Vibe - 2017-01-21
- SAS Visual Analytics: Design Versus Reality - 2016-10-05
- Seize the Day! Submit an #SASGF Abstract - 2016-09-21
- Need a Dynamic X-Axis with Your SAS Visual Analytics Report? - 2016-07-31
- Planning Your SAS Visual Analytics Dashboard - 2016-06-06