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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1961 views
  • 0 likes
  • 3 in conversation