<?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: Proc SQL into (MACRO) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961745#M374908</link>
    <description>&lt;P&gt;Or place an actual character between values. If you see multiples of the character with no readable text between the values then you have missing values for the variable.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2025 01:39:54 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2025-03-13T01:39:54Z</dc:date>
    <item>
      <title>Proc SQL into (MACRO)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961630#M374885</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In data set ttt there are 135 rows&amp;nbsp; (In each row there is a var name in field&amp;nbsp; field_name)&lt;/P&gt;
&lt;P&gt;I am using this code to create a macro var that concatenate the var names&lt;/P&gt;
&lt;P&gt;I see in Log that the macro var has only concatenation of 75 values.&amp;nbsp; WHY????&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select field_name into : Vfields  separated by ' '
from ttt
;
quit;
%put &amp;amp;Vfields;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Mar 2025 05:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961630#M374885</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-03-12T05:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL into (MACRO)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961631#M374886</link>
      <description>Maybe there are some missing value in "field_name ". &lt;BR /&gt;Check it by &lt;BR /&gt;proc freq data=ttt;&lt;BR /&gt;table field_name /missing;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 12 Mar 2025 05:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961631#M374886</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-03-12T05:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL into (MACRO)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961745#M374908</link>
      <description>&lt;P&gt;Or place an actual character between values. If you see multiples of the character with no readable text between the values then you have missing values for the variable.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 01:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961745#M374908</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-03-13T01:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL into (MACRO)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961752#M374913</link>
      <description>&lt;P&gt;There are two things that could cause that.&lt;/P&gt;
&lt;P&gt;The simplest is that some of the field_names are empty.&lt;/P&gt;
&lt;P&gt;In this example the query processed 19 observations but on 10 names where written into the macro variable.&amp;nbsp; &lt;EM&gt;Note; In SAS a MACRO is something completely different than a macro VARIABLE.&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;76   proc sql noprint;
77   select case when(sex='M') then name else ' ' end into :namelist separated by ' '
78   from sashelp.class
79   ;
80   %put &amp;amp;=sqlobs n_names=%sysfunc(countw(&amp;amp;namelist,%str( )));
SQLOBS=19 n_names=10
81   quit;
&lt;/PRE&gt;
&lt;P&gt;The other cause I have seen is queries against Teradata which defaults to returning only the unique set of observations that satisfy the query.&amp;nbsp; &amp;nbsp;So if the same field_name appeared 10 times in the dataset being queried only one copy would be returned.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 03:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-into-MACRO/m-p/961752#M374913</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-13T03:02:08Z</dc:date>
    </item>
  </channel>
</rss>

