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
Thanks, Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.
Not sure about Viya, but in SAS9, you can use the name literal:
'State Region'n
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/ Data Preparation.
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.
Thanks, Rushikesh , and apologies to LinusH - I must have messed up earlier. Glad to know that this works.
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!
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.