<?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: creating a macro sequence variable from a sas dataset (column variables) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518104#M140177</link>
    <description>&lt;P&gt;No idea what you mean.&amp;nbsp; I have done thousands of Demography datasets and outputs (and other domains) and never had to assign a number to each value?&amp;nbsp; I think your probably misunderstanding, or overthinking your original problem, which you haven't told us about.&amp;nbsp; Note SDTM does not include formats, but you could create them internally for an output if really needed.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 14:58:57 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-12-03T14:58:57Z</dc:date>
    <item>
      <title>creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518092#M140168</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wondering if anybody can help me re the following, please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a macro code for a demography table for at least&amp;nbsp;50 variables,&lt;/P&gt;&lt;P&gt;At the moment, I am assigning&amp;nbsp;a sequence&amp;nbsp;number to each variable&amp;nbsp;separately but I think there is a way through proc sql&amp;nbsp;or do loop, to create a list of all variables and then assign a number next to it as store it as a macro variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518092#M140168</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2018-12-03T14:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518095#M140170</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211980"&gt;@Sami1234&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to create a macro code for a demography table for at least&amp;nbsp;50 variables,&lt;/P&gt;
&lt;P&gt;At the moment, I am assigning&amp;nbsp;a sequence&amp;nbsp;number to each variable&amp;nbsp;separately but I think there is a way through proc sql&amp;nbsp;or do loop, to create a list of all variables and then assign a number next to it as store it as a macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The words are not entirely clear to me. Could you give a brief example with three variables of what the starting point is, and what the end result is that you want?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518095#M140170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-03T14:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518104#M140177</link>
      <description>&lt;P&gt;No idea what you mean.&amp;nbsp; I have done thousands of Demography datasets and outputs (and other domains) and never had to assign a number to each value?&amp;nbsp; I think your probably misunderstanding, or overthinking your original problem, which you haven't told us about.&amp;nbsp; Note SDTM does not include formats, but you could create them internally for an output if really needed.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518104#M140177</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-03T14:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518126#M140179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying.&lt;/P&gt;&lt;P&gt;I would like to create a list of macro variables associated with each required variable in the dataset. i.e. age=1, sex=2, bmi=3.&lt;/P&gt;&lt;P&gt;I can put the list of sorting variables, for example, sortlist=age, sex, bmi&amp;nbsp;and then it should create macro variables associated with this sort. Would it be possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518126#M140179</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2018-12-03T15:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518127#M140180</link>
      <description>&lt;P&gt;Again, I'm not following your explanation, and an example (with 3 or 4 variables) would help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518127#M140180</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-03T15:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518140#M140184</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I would like to input a variable list in the proc SQL or loop and would like to create a macro numeric variable associated with it.&lt;/P&gt;&lt;P&gt;Below is the pseudo&amp;nbsp;code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;varlist=(var1, var2 , var3 ...etc)&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;create table seq as&lt;/P&gt;&lt;P&gt;select var(i) from varlist as seq(i);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 16:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518140#M140184</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2018-12-03T16:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating a macro sequence variable from a sas dataset (column variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518143#M140186</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm still not 100% sure I understand, but maybe this is what you are asking for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dothis;
%let varlist=var1 var2 var3;
%do i = 1 %to %sysfunc(countw(&amp;amp;varlist));
    %let seq&amp;amp;i = %scan(&amp;amp;varlist,&amp;amp;i,%str( ));
%end;
%put &amp;amp;=seq1 &amp;amp;=seq2 &amp;amp;=seq3;
%mend;
%dothis&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that's not it, don't write more words, because I am not understanding. SHOW ME. Show me the inputs, show me the outputs. Don't just show me the inputs and then assume I know what you want. You have to show me both the inputs and the outputs.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 16:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-macro-sequence-variable-from-a-sas-dataset-column/m-p/518143#M140186</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-03T16:19:04Z</dc:date>
    </item>
  </channel>
</rss>

