BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SundareshS
Obsidian | Level 7

While trying to import a sas dataset (sas7bdat) in Viya (Prepare / Manage Data) and load into CAS:

 

I turn on the filter rows option on.

 

Using instructions in http://documentation.sas.com/?cdcId=dprepcdc&cdcVersion=2.1&docsetId=datahub&docsetTarget=p1sv89vo4n...

 

I have tried various options on a sample dataset "Digital Clickstream Data" - such as 

 

"State Region" = "Georgia"

'State Region' = "Georgia"

"State Region" = 'Georgia'

 

The problem is - the WHERE condition works perfectly for cases where there are no spaces in the column name (e.g. City="Placintas") however, I get zero rows (no error) whenever I try to use a column name which contains spaces.

 

thanks

 

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
SundareshS
Obsidian | Level 7

Thanks,  Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Not sure about Viya, but in SAS9, you can use the name literal:

'State Region'n

Data never sleeps
SundareshS
Obsidian | Level 7

Thank you - however this did not work  - either with double quotes or single quotes.

 

The attached error might explain better - basically the Filter Row condition is packaged into a WHERE clause, and this seems to be an incorrect syntax.

 

I tried another method - made use of the Viya Filter Data task (in SAS Studio) and obtained the code behind it - however, that still makes use of the ' 'n method for variables with spaces. 

 

This somehow does not seem to work in SAS Data Studio/ Daimport_space_error.pngta Preparation.

Rushikesh
Calcite | Level 5

Hi Sundaresh,

 

I tried to apply filters on similar variable with spaces in variabe name and this is how it worked for me-

 

 

Condition: 

 

'Team Name'n = 'Atlanta'

 

Please check attached screenshots.

 

pic1.jpgpic2.jpg

SundareshS
Obsidian | Level 7

Thanks,  Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1555 views
  • 0 likes
  • 3 in conversation