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)
- Use these 7 Data Storytelling Examples to Make Your Insights more Meaningful Today - 2018-06-09
- Use Network Analysis to Understand Your Customers with SAS Visual Analytics 8.2 - 2018-01-21
- My 7 Favorite Features in SAS Visual Analytics 8.2 on Viya - 2018-01-14
- Designing Dashboards: Finding the Fantastic Five Colors - 2017-06-19
- Creating a Web Analytics Report in SAS Visual Analytics 8.1 - 2017-06-19