<?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 Macro for variable lists in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51184#M14002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that but I don't get the result im looking for. what I specify Physical: a get a return this other variables I don't want like Physical&lt;STRONG&gt;ong. &lt;/STRONG&gt;I am also using lists from dictionary tables so I need to use SQL. Thanks for your input. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2012 02:00:15 GMT</pubDate>
    <dc:creator>Mgarret</dc:creator>
    <dc:date>2012-02-10T02:00:15Z</dc:date>
    <item>
      <title>Macro for variable lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51182#M14000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;Hi all--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: Arial; font-size: 10pt;"&gt;I have to organize a series of datasets which are eventually outputted to xml spreadsheets for reporting purposes. In the datasets, there are a series of variables that startwith &lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;ChildAge Physical Education Emotional and Social. These variables repeat depending on how many cases are evaluated so if 5 cases were evaluated the number of&amp;nbsp; “Physical” variables would be 5 and the variables would look like this Physical1 Physical2 Physical3 Physical4 Physical5. The number of these variables could be different for each dataset. To take the variation into account when forming the final datasets, I wrote a macro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;The issue I’m having is if a specify “9” (or any number) as the parameter, I will only get back up through 8 variables when there is 9 in the dataset or if the parameter is 5 the return will be 4 BUT sometimes for just 1 variable set I will get back all the variables. I used the mprint option to try to see what the issue and the log does show that the correct number of variables are being brought in but when I look at the dataset the last ones are normally missing. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;I can’t figure out what the issue is –any help is greatly appreciated.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;Thank you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;options&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;mprint&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;STRONG style="font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt; test(final);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;create table WANT as &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Select &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Quest &lt;SPAN style="background-color: white;"&gt;"CaseReview #"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Program_Name &lt;SPAN style="background-color: white;"&gt;"Program Name"&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;i = &lt;STRONG style="background-color: white;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white;"&gt;% to&lt;/SPAN&gt; &amp;amp;final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;amp;i ne &amp;amp;final &lt;SPAN style="background-color: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;ChildAge&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Age"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%else &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; ChildAge&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Age"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;"--------&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt; as d2 &lt;SPAN style="background-color: white;"&gt;"Component 1 "&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%do &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;i = &lt;STRONG style="background-color: white;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white;"&gt;% to&lt;/SPAN&gt; &amp;amp;final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;amp;i ne &amp;amp;final &lt;SPAN style="background-color: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Physical&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Physical Development"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%else &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; Physical&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Physical Development"&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;"--------&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;as d3 &lt;SPAN style="background-color: white;"&gt;"Sub-Component 2: Cognitive "&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;i = &lt;STRONG style="background-color: white;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white;"&gt;% to&lt;/SPAN&gt; &amp;amp;final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;amp;i ne &amp;amp;final &lt;SPAN style="background-color: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Education&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Cognitive "&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%else &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; Education&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Cognitive "&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;"--------&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;as d4 &lt;SPAN style="background-color: white;"&gt;"Sub-Component 3: Psychological"&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;i = &lt;STRONG style="background-color: white;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white;"&gt;%to&lt;/SPAN&gt; &amp;amp;final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;amp;i ne &amp;amp;final &lt;SPAN style="background-color: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Emotional&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Psychological"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%else &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; Emotional&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Psychological "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;"--------&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;as d5 &lt;SPAN style="background-color: white;"&gt;"Sub-Component 4: BehavioralAssessment"&lt;/SPAN&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;i = &lt;STRONG style="background-color: white;"&gt;1 &lt;/STRONG&gt;&lt;SPAN style="background-color: white;"&gt;%to&lt;/SPAN&gt; &amp;amp;final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;amp;i ne &amp;amp;final &lt;SPAN style="background-color: white;"&gt;%then&lt;/SPAN&gt; &lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;Social&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Behavioral Assessment"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background-color: white;"&gt;%do&lt;/SPAN&gt;; Social&amp;amp;i &lt;SPAN style="background-color: white;"&gt;"Child #&amp;amp;i Behavioral "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;%end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;"--------&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;as d6 &lt;SPAN style="background-color: white;"&gt;"Sub-Component 5: Source ofAssessment"&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;Q33, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;Q34,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;Q35&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;From HAVE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;%mend test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0.1pt; margin-bottom: 0.1pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;%test(9)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 00:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51182#M14000</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2012-02-10T00:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for variable lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51183#M14001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seem to me this is much easier to do in regular SAS than trying to use MACRO or SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep Quest Program_Name ChildAge: Physical: Education: Emotional: Social: ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 01:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51183#M14001</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-10T01:52:16Z</dc:date>
    </item>
    <item>
      <title>Macro for variable lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51184#M14002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that but I don't get the result im looking for. what I specify Physical: a get a return this other variables I don't want like Physical&lt;STRONG&gt;ong. &lt;/STRONG&gt;I am also using lists from dictionary tables so I need to use SQL. Thanks for your input. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 02:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51184#M14002</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2012-02-10T02:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for variable lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51185#M14003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the purpose of the query?&amp;nbsp; Is it just make a copy of the data with fewer columns?&lt;/P&gt;&lt;P&gt;Why do your datasets have multiple columns instead of multiple rows when there are repititions?&lt;/P&gt;&lt;P&gt;Why do you need to add labels in your SELECT statement? Don' t the variables already have labels in the source dataset?&lt;/P&gt;&lt;P&gt;I would assume the all empty columns are because you tried to pull column ChildAge5 and it did not exist in the source dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are generating the select statement with macro code it will be easier if just have one loop.&amp;nbsp; It will change the order of the variables however.&lt;/P&gt;&lt;P&gt;You do not need any special logic for eliminating comma as you have variables before and after the values generated by the macro logic.&lt;/P&gt;&lt;P&gt;Also I find that long SQL select lists are much easier to read if you place the commas at the beginning of the line instead of the end.&amp;nbsp; They also make a much more pleasing pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;%macro test(final);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quest "CaseReview #"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Program_Name "Program Name"&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;final;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,ChildAge&amp;amp;i "Child #&amp;amp;i Age"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Physical&amp;amp;i "Child #&amp;amp;i Physical Development"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Education&amp;amp;i "Child #&amp;amp;i Cognitive "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Emotional&amp;amp;i "Child #&amp;amp;i Psychological"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Social&amp;amp;i "Child #&amp;amp;i Behavioral Assessment"&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,"--------&amp;gt;" as d6 "Sub-Component 5: Source ofAssessment"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Q33&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Q34&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Q35&lt;/P&gt;&lt;P&gt;&amp;nbsp; from HAVE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;%test(9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 02:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51185#M14003</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-10T02:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for variable lists</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51186#M14004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then use lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P style="background-color: #ffffff;"&gt;%let final=9;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;data want ;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; set have ;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; keep Quest Program_Name &lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ChildAge1-ChildAge&amp;amp;final&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical1-Physical&amp;amp;final&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Education1-Education&amp;amp;final&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emotional1-Emotional&amp;amp;final&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Social1-Social&amp;amp;final&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 02:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-for-variable-lists/m-p/51186#M14004</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-10T02:47:07Z</dc:date>
    </item>
  </channel>
</rss>

