With the release of Viya 3.4, there are now new advanced options available when importing local data files in the user interface. These options are on the Advanced tab and are:
|Note: The Additional Input Options selection is only available for delimited text files.|
Let's look at an example of using these new advanced options when importing a local delimited text file. Here is an image of the file I want to import.
Notice that the rows do not have a unique identifier and there are leading and trailing blanks in some columns. I will use the new advanced import options to address these issues when I import the data.
First, I set up the local text file import as usual on the File Specifications tab.
Next, I select the Advanced tab. Both new advanced options are displayed since I am importing a local delimited text file.
To address the issue of no unique identifier for the rows, I check the Unique ID option and name the new column Unique_ID. There is also an option to Replace column if it already exists on the local file.
Next, to address the issue of leading and trailing blanks in columns, I check the Additional Input Options box and add an option called stripBlanks which is type Boolean and set the value to True in order to have leading and trailing spaces stripped from the columns when the file is imported.
Finally, I import the local file by selecting the Import Item button and then navigate to the CAS library where I imported the data and view the results.
As you can see on the Sample Data tab, I now have a Unique_ID column by using the Unique ID option and have removed the leading and trailing spaces in columns by using the Additional Input Option stripBlanks.
For more information on SAS Viya 3.4 and importing local files, you can refer to the documentation on Importing Local Data Files.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.