<?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 SAS macro variable using Dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592779#M169997</link>
    <description>&lt;P&gt;Why not just try it and see?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2019 17:49:56 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-09-30T17:49:56Z</dc:date>
    <item>
      <title>Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592682#M169959</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on creating macro variable and to use that macro variable as filters&amp;nbsp;in do loop statement to run code for different criteria.&lt;/P&gt;&lt;P&gt;here is the &amp;nbsp;reference code&amp;nbsp;I'm using&amp;nbsp;this for creating filter criteria for single variable (variable name is dn)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;### macro to create filter criteria for dn&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Strip(put(count(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dn),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varCount &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;dn &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varVal1- :varVal&amp;amp;varCount &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%Macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;RA&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; index =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;varCount;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;SYSECHO &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Getting data for &amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE TABLE WORK.ABC_DN AS&lt;/P&gt;&lt;P&gt;SELECT t1.ID,&lt;/P&gt;&lt;P&gt;t1.lt,&lt;/P&gt;&lt;P&gt;t1.cn&lt;/P&gt;&lt;P&gt;FROM WORK.master_data t1&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;WHERE t1.dn =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I'm i scenario to create group of filters to pull data for that criteria, like in below sample data code,&amp;nbsp;for&amp;nbsp;DN = 'CH', FC = 'ABC1' , SFC = 'ABC1234' and PN = 'ch1234', get data from master table. I have multiple line to repeat this process. so i was thinking to create macro variable to store these condition and then call into my macro program to get data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(To be more clear in the above macro, for where statement apart from dn variable, I need to filter with FC, SFC, and PN along with dn.... I'm not finding way to do it. I got dataset below where every individual row, represent filter criteria which i need to use as filter to pull data from master_data set.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; codes;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; FC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; SFC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; PN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ch5678'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC4567'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ch6789'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'hy1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'hy1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'hy234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'hy1236'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'wh1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'wh1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'wh1238'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'wh1239'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Looking for your help&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Mani&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 14:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592682#M169959</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T14:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592708#M169963</link>
      <description>&lt;P&gt;Assumption : that you're trying to split your data set into multiple smaller subsets for processing based on the variables listed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any reason a join wouldn't work? In general, splitting data sets isn't considered efficient in SAS, unless you're having massive space issues. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some references that may help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UCLA introductory tutorial on macro variables and macros&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Tutorial on converting a working program to a macro&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Examples of common macro usage&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/258724"&gt;@Mani1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on creating macro variable and to use that macro variable as filters&amp;nbsp;in do loop statement to run code for different criteria.&lt;/P&gt;
&lt;P&gt;here is the &amp;nbsp;reference code&amp;nbsp;I'm using&amp;nbsp;this for creating filter criteria for single variable (variable name is dn)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;### macro to create filter criteria for dn&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Strip(put(count(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dn),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)) &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varCount &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;select&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;dn &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varVal1- :varVal&amp;amp;varCount &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;%Macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;RA&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; index =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;varCount;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;SYSECHO &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"Getting data for &amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CREATE TABLE WORK.ABC_DN AS&lt;/P&gt;
&lt;P&gt;SELECT t1.ID,&lt;/P&gt;
&lt;P&gt;t1.lt,&lt;/P&gt;
&lt;P&gt;t1.cn&lt;/P&gt;
&lt;P&gt;FROM WORK.master_data t1&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;WHERE t1.dn =&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I'm i scenario to create group of filters to pull data for that criteria, like in below sample data code,&amp;nbsp;for&amp;nbsp;DN = 'CH', FC = 'ABC1' , SFC = 'ABC1234' and PN = 'ch1234', get data from master table. I have multiple line to repeat this process. so i was thinking to create macro variable to store these condition and then call into my macro program to get data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(To be more clear in the above macro, for where statement apart from dn variable, I need to filter with FC, SFC, and PN along with dn.... I'm not finding way to do it. I got dataset below where every individual row, represent filter criteria which i need to use as filter to pull data from master_data set.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; codes;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; FC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; SFC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; PN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ch5678'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC4567'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ch6789'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'hy1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'hy1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'hy234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'hy1236'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'wh1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'wh1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'wh1238'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'wh1239'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Looking for your help&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Mani&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 15:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592708#M169963</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T15:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592712#M169964</link>
      <description>&lt;P&gt;Is there a question here?&amp;nbsp; If so what is it?&lt;/P&gt;
&lt;P&gt;Note there is no need to run your SQL query twice to count how many records it returns. SQL will set SQLOBS to that count for you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select distinct dn 
  into :varVal1- 
  from work.input_dsntm
;
%let varCount=&amp;amp;sqlobs;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 15:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592712#M169964</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-30T15:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592714#M169965</link>
      <description>&lt;P&gt;I think adding macro variables is just going to make things harder to maintain or understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand your goal then something more like&lt;/P&gt;
&lt;PRE&gt;proc sql;
    create table want as
    select &amp;lt;variable list&amp;gt;
    from dataset
    where dn in ('CH' 'HY' 'WH')
       and FC in ('ABC1' 'ABC2' '123ABC' '456ABC' 'ABCXYZ' 'ABCQWE')
       and SFC in ('ABC1234' 'ABC4567' )
       and PN  in ('ch1234' 'ch5678')
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;I didn't put your full list of values for SFC and PN but the pattern should be clear. ( and they appear to be dummy values as well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592714#M169965</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-30T17:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592751#M169986</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New"&gt;I have a data set, from which I need to get new data with multiple variable filter criteria. the code I have shown in my question is what I use to get data using one variable filter. Now i'm in need to uses multiple variable filter as below.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;DN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to execute this code for multiple set of criteria with DN, FC, SFC, PN …..which is there in separate dataset. So i'm using macro program to do this task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 16:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592751#M169986</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T16:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592755#M169987</link>
      <description>Ok, so what's the question for us? &lt;BR /&gt;Is your code not working as expected? Do you not know how to extend it for multiple variables or tables?&lt;BR /&gt;Or are you looking for suggestions to improve this? &lt;BR /&gt;&lt;BR /&gt;I would highly recommend following the second tutorial in my first response. I think you want a data driven approach so creating a small macro and using CALL EXECUTE are a good option. You could do it all from a data step and call execute. &lt;BR /&gt;&lt;BR /&gt;You have not specified what you need as output though. Currently your output table is ABC_DN which gets replaced each time the macro loops. &lt;BR /&gt;Did you mean to have your output table be:&lt;BR /&gt;&lt;BR /&gt;ABC_&amp;amp;DN. so it is dynamic?</description>
      <pubDate>Mon, 30 Sep 2019 16:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592755#M169987</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T16:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592757#M169989</link>
      <description>I don’t know how to do it for multiple variable. I was able to do it for single variable.&lt;BR /&gt;&lt;BR /&gt;I got dataset, each row combination represent filter criteria... I don’t to how to convert this to macro variable with each unique row in the dataset and use it in my macro do loop function.&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Sep 2019 16:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592757#M169989</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T16:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592758#M169990</link>
      <description>&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT color="#000000" face="Calibri"&gt;I don’t know how to do it for multiple variable. I was able to do it for single variable.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT color="#000000" face="Calibri"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT color="#000000" face="Calibri"&gt;I got dataset, each row combination represent filter criteria... I don’t to how to convert this to macro variable with each unique row in the dataset and use it in my macro do loop function.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 16:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592758#M169990</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T16:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592759#M169991</link>
      <description>Then follow the tutorial I linked to. First provide working code that has no macro variables that does what you want and then you convert that to a macro. This is the best, fastest and most error proof method to write a macro.</description>
      <pubDate>Mon, 30 Sep 2019 16:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592759#M169991</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592760#M169992</link>
      <description>&lt;P&gt;Still not that clear.&amp;nbsp; Is the data you are showing the set of CRITERIA to use to query some other dataset?&amp;nbsp; Or the data to be queried?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data is the criteria then perhaps you just want to generate different macro variables for each actual variable?&lt;/P&gt;
&lt;P&gt;If you want to make the same style of a series of macro variables you could just use the data step iteration number to help generate the macro variable name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set values_list ;
  call symputx(cats('dn',_n_),dn);
  call symputx(cats('fc',_n_),fc);
  call symputx(cats('sfc',_n_),sfc);
  call symputx(cats('pn',_n_),pn);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Put it is probably going to be easier eliminate the series of macro variables and the complexity it requires and instead make a macro that takes the four values as inputs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro run_one(dn,fc,sfc,pn);
....
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then call it from the list of values dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 set list_of_values;
 call execute(cats('%nrstr(%run_one)(',dn,',',fc,',',sfc,',',pn,')'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 16:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592760#M169992</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-30T16:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592766#M169993</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Is the data you are showing the set of CRITERIA to use to query some other dataset?&amp;nbsp; Or the data to be queried?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;the data I'm showing is the list of unique filter combination. (Below is an example). Here is how criteria dataset looks like. This is used to query some other dataset. (using where statement, each row combination in the below dataset will be the filter criteria... in same combination)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; codes;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; FC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; SFC $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; PN $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch5678'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC4567'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch6789'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'456ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy1236'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'wh1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABCXYZ'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'XYZ123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'wh1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'wh1238'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'WH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABCQWE'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC456'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'wh1239'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;if the data is the criteria then perhaps you just want to generate different macro variables for each actual variable?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;FONT color="#0000ff"&gt;yes, I want to generate macro variable which want to use in below do loop macro. Below macro do loop is what I have created for one variable - dn. I want to filter for dn, fc, sfc and pn (multiple variable as macro.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;STRONG&gt;%Macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;RA&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; index =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;varCount;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;PROC SQL;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;SYSECHO &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;"Getting data for &amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;CREATE TABLE WORK.ABC_DN AS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;SELECT t1.ID,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;t1.lt,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;t1.cn&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;FROM WORK.master_data t1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;WHERE t1.dn =&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;"&amp;amp;&amp;amp;varVal&amp;amp;index."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;Run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;%end;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;%mend;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN style="text-align: left; color: #333333; text-transform: none; line-height: 21.33px; text-indent: 0px; letter-spacing: normal; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; text-decoration: none; word-spacing: 0px; display: inline !important; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: transparent;"&gt;&lt;FONT color="#0000ff"&gt;This is the statement I used to get all value in one variable to pass into above macro loop&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Strip(put(count(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dn),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)) &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varCount &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;select&lt;/FONT&gt; &lt;FONT face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;dn &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :varVal1- :varVal&amp;amp;varCount &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.input_dsntm;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99cc00"&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; color: #333333; display: inline; float: none; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;FONT color="#0000ff"&gt;Other info: each time I run macro do loop, I use the output dataset for some analysis, result of which I record in seperate dataset.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; color: #333333; display: inline; float: none; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;FONT color="#0000ff"&gt;Hope this is clear, sorry for confusion.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592766#M169993</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T17:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592768#M169994</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro demo(DN=, FC=, SFC=, PN=, dsn=);

CREATE TABLE WORK.&amp;amp;dsn AS

SELECT t1.ID,

t1.lt,

t1.cn

FROM WORK.master_data t1

WHERE t1.DN= "&amp;amp;DN" 
&amp;amp; t1.FC = "&amp;amp;FC"
&amp;amp; t1.SFC = "&amp;amp;SFC"
&amp;amp; t1.PN = "&amp;amp;PN";

%mend;

data execute_code;

set codes;

str = catt('%demo(DN='
, DN, 
", FC = ",
 FC,
 " , SFC=", 
SFC, 
" , PN = ",
PN,
", DSN= ",
DSN,
");"
);

*call execute(str);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure the STR variable looks like this first:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%demo(DN=CH, FC=ABC1, SFC=ABC1234, PN=ch1234, dsn=DATA1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Add a variable DSN to your CODES data set, this will control thename of the ouptut data set&lt;/P&gt;
&lt;P&gt;2. Verify the macro demo works using a %demo call&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Try the data step, making sure the STR variable is created properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Once that's confirmed, uncomment the CALL EXECUTE portion and it will call your macro for each line in the CODES data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/258724"&gt;@Mani1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT face="Calibri" color="#000000"&gt;I don’t know how to do it for multiple variable. I was able to do it for single variable.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT face="Calibri" color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="margin: 0px;"&gt;&lt;FONT face="Calibri" color="#000000"&gt;I got dataset, each row combination represent filter criteria... I don’t to how to convert this to macro variable with each unique row in the dataset and use it in my macro do loop function.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592768#M169994</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T17:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592769#M169995</link>
      <description>&lt;P&gt;This is what is sounds like to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably do NOT want to put the values of DN and SN into the same macro variable named VARVAL1.&lt;/P&gt;
&lt;P&gt;Instead you should just make a different macro variable for each source REAL variable.&amp;nbsp; It is probably easiest if you just name the macro variables using the same name as the real variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select distinct
       dn
     , fc
     , sfc
     , pn
  into :dn1-
     , :fc1-
     , :sfc1-
     , :pn1-
from work.input_dsntm
;
%let varCount=&amp;amp;sqlobs;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then in the body of your code you can use the same pattern to find the right macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where t1.dn = "&amp;amp;&amp;amp;DN&amp;amp;index."
  and t1.fc = "&amp;amp;&amp;amp;FC&amp;amp;index."
  and t1.sfc = "&amp;amp;&amp;amp;SFC&amp;amp;index."
  and t1.pn = "&amp;amp;&amp;amp;PN&amp;amp;index."
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592769#M169995</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-30T17:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592776#M169996</link>
      <description>&lt;P&gt;Thank you Tom and Reeza for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Tom,&amp;nbsp; in the code you have provided below,&amp;nbsp; please advice if it read each row in my dataset and assign values I described in below example.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;SPAN class="token statement" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #0000ff; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #0000ff; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; fc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; sfc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; pn&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #0000ff; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; :dn1&lt;/SPAN&gt;&lt;SPAN class="token operator" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; :fc1&lt;/SPAN&gt;&lt;SPAN class="token operator" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; :sfc1&lt;/SPAN&gt;&lt;SPAN class="token operator" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt; :pn1&lt;/SPAN&gt;&lt;SPAN class="token operator" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 16.8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;-&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;FONT color="#008000"&gt;For example&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;FONT color="#0000ff"&gt;for the below dataset, when I use above code, &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;FONT color="#0000ff"&gt;dn1 will be CH, fc1 will be 'ABC1' sfc1 will be 'ABC1234 and pn1 will be 'ch1234, and same way&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21px; -ms-hyphens: none; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: 0px; word-wrap: normal;"&gt;&lt;FONT color="#0000ff"&gt;dn2 will be CH, fc2 will be ABC1, sfc2 will be 'ABC1234' and pn2 will be 'ch5678, and so on.... please confirm. I will try this.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch5678'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC4567'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'CH'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'ch6789'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy1234'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT face="Courier New" size="3"&gt;DN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'HY'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; FC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'123ABC'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; SFC = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'1ABC123'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; PN = &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;'hy1235'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas,Monaco,&amp;quot;Andale Mono&amp;quot;,&amp;quot;Ubuntu Mono&amp;quot;,monospace"&gt;Thanks for your support&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas,Monaco,&amp;quot;Andale Mono&amp;quot;,&amp;quot;Ubuntu Mono&amp;quot;,monospace"&gt;Mani.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592776#M169996</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-09-30T17:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592779#M169997</link>
      <description>&lt;P&gt;Why not just try it and see?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 17:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592779#M169997</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-30T17:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592801#M170008</link>
      <description>So Tom's approach and my approach are different. You need to pick one and go with that. I'm not a fan of macro loops as they're harder to debug, and if you have the data in a data set, a data driven approach works for me. Ultimately, it's your choice. You can always try both to see the differences, but please be clear in your responses in which approach you're trying so that we can respond appropriately.</description>
      <pubDate>Mon, 30 Sep 2019 19:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/592801#M170008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T19:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/594012#M170593</link>
      <description>&lt;P&gt;I tried it&amp;nbsp; yesterday, and it worked well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 02:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/594012#M170593</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-10-04T02:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating SAS macro variable using Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/594015#M170594</link>
      <description>&lt;P&gt;thank you for your support... I was trying both the approach and learning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 02:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-SAS-macro-variable-using-Dataset/m-p/594015#M170594</guid>
      <dc:creator>Mani1</dc:creator>
      <dc:date>2019-10-04T02:41:48Z</dc:date>
    </item>
  </channel>
</rss>

