BookmarkSubscribeRSS Feed
eslna
Obsidian | Level 7

Hello all!

 

I have a situation that I hope has an easy fix. I need to write a Data query in SAS VA that uses a CSV and a database table and joins them to produce a LASR table as output.

 

I have a csv file with 3 columns, they should all be treated as character columns, however, because two of those columns have numbers in them, the Import tool in SAS VA decides to turn them into numeric columns.

 

The issue with this is that i need to join this table to another table and I need to use one of those character columns as a key, the foreign key is of character type and i cannot change this.

 

I was wondering if there was a way to "force" the input tool to recognize that column as character instead of numeric.

 

I tried using an excel file instead of csv, and changed the column types to character but that did not help at all

5 REPLIES 5
Madelyn_SAS
SAS Super FREQ

In the Excel version, enter a blank value in each column that is otherwise all numeric.

 

This SAS note might be helpful: http://support.sas.com/kb/56/049.html

eslna
Obsidian | Level 7

Thanks! will look into this.

SASKiwi
PROC Star

In my opinion, the best way to control CSV data coming into VA, would be to write a DATA step program in VA's SAS Studio coding interface. The DATA step allows you to enforce your required data types. 

eslna
Obsidian | Level 7

I do agree with you, however, non-technical users will be using VA and will expect to be able to import csv's and join them to pre-existing tables in SAS without the use of Base SAS.

SASKiwi
PROC Star

I checked the VA import process and there isn't an option to enforce data type - not in VA 7.4 anyway. The only option I can think of is to put a dummy row of data at the start of the CSV to get the type you require, then delete it once it is imported.  

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1255 views
  • 0 likes
  • 3 in conversation