<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS studio problems with selecting with a where clause in proc sql. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628365#M8870</link>
    <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my apologies, that was a copying error when I brought my code into the reply box. I did have the code spaced as you did in your reply. When I ran the data step the log reports:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;74         data varData;
 75         length varnames $20. vardisplays $20.;
 76         infile datalines dlm = ",";
 77         input varnames $ vardisplays $;
 78         datalines;
 
 NOTE: The data set WORK.VARDATA has 1 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The output data tab also shows a 1x2 table with the data as I entered it. When I run the proc sql afterwards, the log reports:&lt;/P&gt;&lt;PRE&gt; 74         proc sql;
 75         select * from varData where varnames = "sodium";
 NOTE: No rows were selected.
 76         quit;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds&lt;/PRE&gt;&lt;P&gt;This code also works completely as expected when I run it without modification on the desktop version of sas, which is 9.4 by the way. I can confirm that there are no syntax errors or typos of any kind. This appears to be purely SAS studio issue.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 22:10:32 GMT</pubDate>
    <dc:creator>icrandell</dc:creator>
    <dc:date>2020-02-28T22:10:32Z</dc:date>
    <item>
      <title>SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628356#M8868</link>
      <description>&lt;P&gt;I'm writing a macro to allow a user to select a subset of columns in a data table by name and then produce summaries appropriate to the type of the data in the column. The first step is to create a data set with the appropriate names to control a call execute routine. It looks like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; varData&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; varnames &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt; vardisplays &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; datalines dlm &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;","&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; varnames &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt; vardisplays &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;sodium, Sodium (Na)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here, varnames will be the names of the columns in the data set to summarize and vardisplays will be a (possibly long) string to describe the variable. But, I have the following issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; varData &lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; varnames &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"sodium"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This does not return any rows, even though there's a clearly a "sodium" in the varnames column. This is a problem, because I'll later need to join this data table with sashelp.vcolumn to get the data type of the column in question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, this is where it gets really fun. I ran that example on sas studio version 3.8 and got the behavior I described above. I then went and ran it on the desktop version and it behaved as expected, that is, it gave me the observation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what the heck is going on with sas studio here?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 21:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628356#M8868</guid>
      <dc:creator>icrandell</dc:creator>
      <dc:date>2020-02-28T21:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628361#M8869</link>
      <description>&lt;P&gt;What does you SAS log say for the data step? How many lines did it read? How many observations did it write?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does not look like you gave it any lines of data.&lt;/P&gt;
&lt;P&gt;Your data step should look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data varData;
  length varnames $20 vardisplays $20;
  infile datalines dlm = ",";
  input varnames $ vardisplays $;
datalines;
sodium, Sodium (Na)
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice how the lines of data start in column 1.&amp;nbsp; Notice how the data lines ending is marked by a line with a semi-colon on it.&amp;nbsp; You don't need that extra RUN: statement between your data step and your PROC step.&amp;nbsp; It doesn't hurt anything, other than to confuse novice SAS programmers into thinking the data step continues beyond the data lines.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 21:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628361#M8869</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-28T21:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628365#M8870</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my apologies, that was a copying error when I brought my code into the reply box. I did have the code spaced as you did in your reply. When I ran the data step the log reports:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;74         data varData;
 75         length varnames $20. vardisplays $20.;
 76         infile datalines dlm = ",";
 77         input varnames $ vardisplays $;
 78         datalines;
 
 NOTE: The data set WORK.VARDATA has 1 observations and 2 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The output data tab also shows a 1x2 table with the data as I entered it. When I run the proc sql afterwards, the log reports:&lt;/P&gt;&lt;PRE&gt; 74         proc sql;
 75         select * from varData where varnames = "sodium";
 NOTE: No rows were selected.
 76         quit;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds&lt;/PRE&gt;&lt;P&gt;This code also works completely as expected when I run it without modification on the desktop version of sas, which is 9.4 by the way. I can confirm that there are no syntax errors or typos of any kind. This appears to be purely SAS studio issue.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 22:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628365#M8870</guid>
      <dc:creator>icrandell</dc:creator>
      <dc:date>2020-02-28T22:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628367#M8871</link>
      <description>&lt;P&gt;Make sure there are not "invisible" characters in either your data lines or your WHERE statement.&lt;/P&gt;
&lt;P&gt;Common characters that to not print any ink on the page are:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;09 - Tab&lt;/P&gt;
&lt;P&gt;0A - Linefeed&lt;/P&gt;
&lt;P&gt;0D - Carriage Return&lt;/P&gt;
&lt;P&gt;A0 - "non-breaking" space&lt;/P&gt;
&lt;P&gt;00 - null&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the $HEX format to see the actual codes of the characters in the strings.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 22:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628367#M8871</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-28T22:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628890#M8879</link>
      <description>&lt;P&gt;The hex solution did it. It turns out there was a leading tab, which I had used to align the text. Frustrating that sas studio seemed to include the leading tab where sas desktop did not.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 19:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628890#M8879</guid>
      <dc:creator>icrandell</dc:creator>
      <dc:date>2020-03-02T19:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS studio problems with selecting with a where clause in proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628906#M8880</link>
      <description>&lt;P&gt;You can change the editor preference to have it insert spaces instead of literal tab characters.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 20:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-studio-problems-with-selecting-with-a-where-clause-in-proc/m-p/628906#M8880</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-02T20:16:52Z</dc:date>
    </item>
  </channel>
</rss>

