<?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 Symget function with the in operator in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22425#M3628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to specify a list of values using the in operator in the where statement of a data step view.&amp;nbsp; I have a macro variable that resolves to the list of values.&amp;nbsp; The value of this macro variable is not constant, so the symget/resolve function needs to be used to obtain the value of the macro variable during execution time whenever the view is referenced.&amp;nbsp; The problem is that the in operator expects a list of quoted strings, not a function such as symget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simplified example.&amp;nbsp; The following code works fine for one name:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name = symget(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'name'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name=Barbara;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name=Jane;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, suppose I have a single macro variable that resolves to a list of students such as:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; names=Barbara James;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This modified code will produce an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name in (symget(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'names'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: white;"&gt;Can anyone think of a simple code modification or an alternative view that will make this problem work?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2011 15:48:53 GMT</pubDate>
    <dc:creator>polingjw</dc:creator>
    <dc:date>2011-06-28T15:48:53Z</dc:date>
    <item>
      <title>Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22425#M3628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to specify a list of values using the in operator in the where statement of a data step view.&amp;nbsp; I have a macro variable that resolves to the list of values.&amp;nbsp; The value of this macro variable is not constant, so the symget/resolve function needs to be used to obtain the value of the macro variable during execution time whenever the view is referenced.&amp;nbsp; The problem is that the in operator expects a list of quoted strings, not a function such as symget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simplified example.&amp;nbsp; The following code works fine for one name:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name = symget(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'name'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name=Barbara;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name=Jane;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, suppose I have a single macro variable that resolves to a list of students such as:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; names=Barbara James;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This modified code will produce an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name in (symget(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'names'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: white;"&gt;Can anyone think of a simple code modification or an alternative view that will make this problem work?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 15:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22425#M3628</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-06-28T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22426#M3629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may have to give up the in operator. Code snipet below utilizes the indexw function, instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;=students;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; indexw(symget(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;'names'&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;), name, &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; names=Barbara James;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;print&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;=students;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Courier New; font-size: 9pt;"&gt;/* on lst&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000; font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sex&amp;nbsp;&amp;nbsp;&amp;nbsp; Age&amp;nbsp;&amp;nbsp;&amp;nbsp; Height&amp;nbsp;&amp;nbsp;&amp;nbsp; Weight&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000; font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Barbara&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 98&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000; font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; James&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 57.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 83&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000; font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 16:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22426#M3629</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-06-28T16:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22427#M3630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that’s exactly what I was looking for.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 17:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22427#M3630</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-06-28T17:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22428#M3631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp; %let names=Barbara James;


data students/view=students;
set sashelp.class;
 where name in (&amp;nbsp; %sysfunc(tranwrd(%sysfunc(quote(&amp;amp;names)),%str( ),%str(" ")) )&amp;nbsp;&amp;nbsp; );
&amp;nbsp;&amp;nbsp; run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 03:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22428#M3631</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-29T03:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22429#M3632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for replying Ksharp, but this solution does not solve the problem.&amp;nbsp; The problem is not the quotes; rather it is a timing issue.&amp;nbsp; I need for the macro variable to be resolved at execution time, thus the use of the SYMGET function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chang’s solution works well, but if anyone can think of a way to utilize the in operator, that would be even better.&amp;nbsp; The reason the in operator would be better is because I’m actually working with a SAS view that is based on a SAS/ACCESS view.&amp;nbsp; The INDEXW function is not passed to the DBMS for processing, where a list of values specified via the in operator is passed to the DBMS.&amp;nbsp; Thus the INDEXW function runs slower.&amp;nbsp; However, I’m not confident that such a solution is possible.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the INDEXW solution becomes too slow, I might have to create a macro containing the code to create the view (using the in operator) and then call the macro to re-compile the view before each use.&amp;nbsp; This would not be very hard to implement, I just wanted to know if there was a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp; again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 10:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22429#M3632</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-06-29T10:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22430#M3633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That all sounds very complicated.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you adapt this form of the IN operator?&amp;nbsp; It may have the same pass through problems as the INDEXW function.&amp;nbsp; Which of course would also be a problem for SYMGET if it worked in IN operator as it would not be passed through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; sashelp.class&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; names);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 11:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22430#M3633</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-06-29T11:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22431#M3634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right, the SYMGET function would not be passed to the DBMS either.&amp;nbsp; Therefore, even if somehow I could use the in operator in conjunction with SYMGET, the execution time would not be any quicker.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the SQL suggestion.&amp;nbsp; I would rather keep using a DATA step because the actual view is a bit more involved and includes FIRST. and LAST. variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don’t think that re-compiling the code before each use is that complicated.&amp;nbsp; For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;STRONG&gt;&lt;EM&gt;compile&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; data students/view=students;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; set sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where name in (&amp;amp;names);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; names="Barbara" "James";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;compile&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; names="Henry" "Janet";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;compile&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=students; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again to everyone for the great suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 11:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22431#M3634</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-06-29T11:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22432#M3635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;%let names=Barbara James;


data students/view=students;
set sashelp.class;
 where symget('names') contains trim(name);
&amp;nbsp;&amp;nbsp; run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 01:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22432#M3635</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-01T01:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22433#M3636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Ksharp: You have to match word boundaries as well, whenever you want to match words. See below for one way of doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you may end up matching a partial word as if it was a full word. For instance, your view could end up including Barbara's observation when the name is, say, "Ba". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; names=Barbara James;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; students/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;=students;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; sashelp.class;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 9pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt; cat(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;, trim(symget(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;'names'&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;)), &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contains cat(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;, trim(name), &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 9pt;"&gt;" "&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; font-size: 9pt; font-family: Courier New;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Chang Y. Chung -- changed cats to cat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 03:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22433#M3636</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-07-01T03:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Symget function with the in operator</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22434#M3637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code is wrong. Function cats() has already deleted the first and last white blank.&lt;/P&gt;&lt;P&gt;Solution is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data class;
 set sashelp.class end=last;
 output;
 if last then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=' Bar Pe ';output;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=' Bar ';output;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
run;

%let names=Barbara James;
&amp;nbsp; data students/view=students;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set class;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where " "||symget('names')||" "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contains&amp;nbsp; " "||strip(name)||" ";
&amp;nbsp; run;




Or using like operator&amp;nbsp;&amp;nbsp;&amp;nbsp; 
" "||symget('names')||" " like "% "||strip(name)||" %"
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 01:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Symget-function-with-the-in-operator/m-p/22434#M3637</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-04T01:53:23Z</dc:date>
    </item>
  </channel>
</rss>

