<?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: Macro : Read values from a macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762310#M241340</link>
    <description>&lt;P&gt;I think that you may seriously want to consider just how you are building that list of variables and what you expect to do with it. You have repeats of the same value such as&lt;/P&gt;
&lt;PRE&gt;CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR&lt;/PRE&gt;
&lt;P&gt;which means that you will likely repeat the same thing 5 times for that value. Which means a likely waste of clock cycles.&lt;/P&gt;
&lt;P&gt;There are several of these repeated values, so even more wasted clock cycles.&lt;/P&gt;
&lt;P&gt;OR you are going to have to provide more information somewhere if each of those repeats is to be treated differently. Which means that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s concise solution may be insufficient in the real task.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 15:18:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-18T15:18:13Z</dc:date>
    <item>
      <title>Macro : Read values from a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762298#M241333</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the macro variable &lt;STRONG&gt;list , &lt;/STRONG&gt;how can we read these values one at a time from this macro variable..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;list;&lt;BR /&gt;AE AE AEMDSAML AEMDSAML AEMDSAML AEMDSAML AEPNEU AEPNEU AEPNEU AEPNEU AESPM AESPM AESPM C19ASMT CM CNCRTX CNCRTX CNCRTX&lt;BR /&gt;CNCRTX_1 CNCRTX_1 CNCRTX_1 CP CP CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR&lt;BR /&gt;CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CHF_CR CVEVT_CVATIA_CR&lt;BR /&gt;CVEVT_CVATIA_CR CVEVT_CVATIA_CR CVEVT_CVATIA_CR CVEVT_DEATH_CR CVEVT_DEATH_CR CVEVT_DVT_CR CVEVT_DVT_CR CVEVT_DVT_CR&lt;BR /&gt;CVEVT_DVT_CR CVEVT_DVT_CR CVEVT_DVT_CR CVEVT_DVT_CR CVEVT_MYOINF_CR CVEVT_MYOINF_CR CVEVT_MYOINF_CR CVEVT_MYOINF_CR&lt;BR /&gt;CVEVT_MYOINF_CR CVEVT_MYOINF_CR CVEVT_MYOINF_CR CVEVT_MYOINF_CR CVEVT_PAT_CR CVEVT_PAT_CR CVEVT_PAT_CR CVEVT_PAT_CR&lt;BR /&gt;CVEVT_PULHYP_CR CVEVT_PULHYP_CR CVEVT_PULHYP_CR CVEVT_PULHYP_CR CVEVT_REVAS_CR CVEVT_REVAS_CR CVEVT_VALV_CR&lt;BR /&gt;CVEVT_VALV_CR CVEVT_VALV_CR CVEVT_VALV_CR CVEVT_VALV_CR CVEVT_VALV_CR DA DEATH DEATH DM DM DM DS EOTN EOTN EOTT EVAL EX&lt;BR /&gt;EX_15 EX_IV EX_IV FD FUACT FUACT HVT ICF_WITH IE IE INDTX INDTX INF_CONSENT INF_CONSENT LBIOPSY_CR LBIOPSY_CR_1 LB_CHEM&lt;BR /&gt;LB_COAG LB_HEMA LB_LIPID LB_URIN LEREPORT_CR LEREPORT_CR LIMAGING_CR MEDHIST_A_LIVER_CR MH NESCREEN NSCLCHIS NSCLCHIS&lt;BR /&gt;NSCLCHIS NTM OH PHEM PK_LIVER_PKSMPID PR PR_FCR PR_IMG PV QS RAND RUCAM_CR SAE SI SUBUSE_AL_LIVER_CR SURVSTAT TLSUM TSH&lt;BR /&gt;TUNL TUNL TUNT2 TUNT2 TUTG2 TUTG2 UNSCH UPT VS VS_1&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 15:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762298#M241333</guid>
      <dc:creator>Stephenjohn</dc:creator>
      <dc:date>2021-08-18T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro : Read values from a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762300#M241334</link>
      <description>&lt;P&gt;Inside a macro&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i=1 %to %sysfunc(countw(&amp;amp;list));
    %let thisvar = %scan(&amp;amp;list,&amp;amp;i,%str( ));
    /* Do some action with &amp;amp;thisvar */
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Aug 2021 15:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762300#M241334</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-18T15:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro : Read values from a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762309#M241339</link>
      <description>&lt;P&gt;You may find these helpful:&lt;/P&gt;
&lt;H1 class="xisDoc-title"&gt;SAS Macro Examples&lt;/H1&gt;
&lt;DIV class="xisDoc-chapterRule"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc"&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0ctmldxf23ixtn1kqsoh5bsgmg8.htm" target="_blank"&gt;Example 1: Import All CSV Files That Exist within a Directory&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0js70lrkxo6uvn1fl4a5aafnlgt.htm" target="_blank"&gt;Example 2: List All Files within a Directory Including Subdirectories&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p02f7difkhfytsn1dzhaas0rdf4n.htm" target="_blank"&gt;Example 3: How to Increment a Macro DO Loop by a Non-integer Value&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1qvxz5u3uru7yn1nk7q64ohvwak.htm" target="_blank"&gt;Example 4: How to Use Character Values on a Macro %DO Loop&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0na9f3e0qxdazn1lh6o7s919lrq.htm" target="_blank"&gt;Example 5: Place All SAS Data Set Variables into a Macro Variable&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1ns5wvyfxbca8n1l3konj0yj6nq.htm" target="_blank"&gt;Example 6: How to Retrieve the Program Name That Is Currently Running in Batch Mode or Interactively&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1bt60e9njvmfon10r7grgczgjqp.htm" target="_blank"&gt;Example 7: Using a Macro to Create New Variable Names from Variable Values&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0s4xeo2nzqhdtn177qgad6iz69f.htm" target="_blank"&gt;Example 8: Dynamically Determine the Number of Observations and Variables in a SAS Data Set&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1hogk0ekd1z62n18xx76ou16unt.htm" target="_blank"&gt;Example 9: Use Macro Logic to Determine If an External File Is Empty&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1n2i0ewaj1zian1ria5579z1zjh.htm" target="_blank"&gt;Example 10: Retrieve Each Word from a Macro Variable List&lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n01vuhy8h909xgn16p0x6rddpoj9.htm" target="_blank"&gt;Example 11: Loop through Dates Using a Macro %DO Loop&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p10yr6jbpc8t6dn1xurxomzg37fl.htm" target="_blank"&gt;Example 12: Using Macro Variables within a CARDS or DATALINES Statement&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p011imau3tm4jen1us2a45cyenz9.htm" target="_blank"&gt;Example 13: Print Information to the Output Window If a Data Set Is Empty&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1acepp9c1x5mbn1f0fuyf1zggx5.htm" target="_blank"&gt;Example 14: Create a Quoted List Separated by Spaces&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n108rtvqj4uf7tn13tact6ggb6uf.htm" target="_blank"&gt;Example 15: Delete a File If It Exists&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1wyzhuyjmwfsun1iwqnluezhql9.htm" target="_blank"&gt;Example 16: Retrieve the File Size, Create Time, and Last Modified Date of an External File&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV class="xisDoc-toc_1"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0j1htu10wsx9tn1mig5g0b8mxxb.htm" target="_blank"&gt;Example 17: Delete All User-defined Macro Variables&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Aug 2021 15:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762309#M241339</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-18T15:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro : Read values from a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762310#M241340</link>
      <description>&lt;P&gt;I think that you may seriously want to consider just how you are building that list of variables and what you expect to do with it. You have repeats of the same value such as&lt;/P&gt;
&lt;PRE&gt;CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR CVEVT_ARRH_CR&lt;/PRE&gt;
&lt;P&gt;which means that you will likely repeat the same thing 5 times for that value. Which means a likely waste of clock cycles.&lt;/P&gt;
&lt;P&gt;There are several of these repeated values, so even more wasted clock cycles.&lt;/P&gt;
&lt;P&gt;OR you are going to have to provide more information somewhere if each of those repeats is to be treated differently. Which means that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s concise solution may be insufficient in the real task.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 15:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Read-values-from-a-macro-variable/m-p/762310#M241340</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-18T15:18:13Z</dc:date>
    </item>
  </channel>
</rss>

