<?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: How to understand the following call symput in macro? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52019#M10957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are two observations then it will generate 5 macro variables.&amp;nbsp; Equivalent to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;%let C_1=1&lt;/P&gt;&lt;P&gt;%let N_1=410;&lt;/P&gt;&lt;P&gt;%let M=1;&lt;/P&gt;&lt;P&gt;%let C_2=2;&lt;/P&gt;&lt;P&gt;%let N_2=35;&lt;/P&gt;&lt;P&gt;%let M=2;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;You can check this by using %PUT statements after the data step.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;%put c_1="&amp;amp;c_1" n_1="&amp;amp;n_1" c_2="&amp;amp;c_2" n_2="&amp;amp;N_2" m="&amp;amp;m";&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Apr 2012 04:09:22 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-04-01T04:09:22Z</dc:date>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52016#M10954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I was learning macro from books, there some code as below in a macro,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set Temp_Cats;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("C_" || left(_N_), compress(IV_Bin)); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("n_" || left(_N_), left(count));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("M", left(_N_));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Run;&lt;/P&gt;&lt;P&gt;I can not have a visual sightseeing as how the 3 call symput did, no matter in log /output window.&lt;/P&gt;&lt;P&gt;Can anyone help to explain what the 3 call symput do?&lt;/P&gt;&lt;P&gt;very thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 03:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52016#M10954</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-01T03:43:22Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52017#M10955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2 obs of data Temp_cats&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 162pt; border-collapse: collapse;" width="216"&gt;&lt;TBODY&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD class="xl22" height="20" style="width: 54pt; height: 15pt;" width="72"&gt;IV_Bin&lt;/TD&gt;&lt;TD class="xl23" style="border-left: medium none; width: 54pt;" width="72"&gt;Count&lt;/TD&gt;&lt;TD class="xl24" style="border-left: medium none; width: 54pt;" width="72"&gt;Percent&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 14.25pt;"&gt;&lt;TD align="right" class="xl25" height="19" style="border-top: medium none; height: 14.25pt;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl26" style="border-top: medium none; border-left: medium none;"&gt;410&lt;/TD&gt;&lt;TD align="right" class="xl27" style="border-top: medium none; border-left: medium none;"&gt;8.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" class="xl28" height="20" style="border-top: medium none; height: 15pt;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl29" style="border-top: medium none; border-left: medium none;"&gt;35&lt;/TD&gt;&lt;TD align="right" class="xl30" style="border-top: medium none; border-left: medium none;"&gt;0.7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 03:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52017#M10955</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-01T03:51:17Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52018#M10956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to create macro variables&amp;nbsp; &amp;amp;c_1 &amp;amp;c_2 &amp;amp;n_1 &amp;amp;n_2 &amp;amp;m;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "C_" || left(_N_) is macro name, when _n_=1 ,&amp;nbsp; "C_" || left(_N_) becomes c_1.&amp;nbsp; compress(IV_Bin) is macro value, when _n_=1 , compress(IV_Bin) is 1.&amp;nbsp; so &amp;amp;c_1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run the code below and check the log file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp_cats;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input IV_Bin&amp;nbsp; count;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 410&lt;/P&gt;&lt;P&gt;2 35&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set Temp_Cats;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("C_" || left(_N_), compress(IV_Bin));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("n_" || left(_N_), left(count));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("M", left(_N_));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Run;&lt;/P&gt;&lt;P&gt; %put&amp;nbsp; &amp;amp;c_1 &amp;amp;c_2 &amp;amp;n_1 &amp;amp;n_2 &amp;amp;m;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 04:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52018#M10956</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-04-01T04:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52019#M10957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are two observations then it will generate 5 macro variables.&amp;nbsp; Equivalent to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;%let C_1=1&lt;/P&gt;&lt;P&gt;%let N_1=410;&lt;/P&gt;&lt;P&gt;%let M=1;&lt;/P&gt;&lt;P&gt;%let C_2=2;&lt;/P&gt;&lt;P&gt;%let N_2=35;&lt;/P&gt;&lt;P&gt;%let M=2;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;You can check this by using %PUT statements after the data step.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;%put c_1="&amp;amp;c_1" n_1="&amp;amp;n_1" c_2="&amp;amp;c_2" n_2="&amp;amp;N_2" m="&amp;amp;m";&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 04:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52019#M10957</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-01T04:09:22Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52020#M10958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Linlin, thanks for your reply,&lt;/P&gt;&lt;P&gt;can you go further as to tell why left and compress functions are used?&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 04:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52020#M10958</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-01T04:16:50Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52021#M10959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Tom,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 04:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52021#M10959</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-01T04:17:31Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52022#M10960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"left" moves the number to left. without using "left" function, "c_1" will be "c_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1". "compress" also takes out extra spaces.&lt;/P&gt;&lt;P&gt;Below is the log file without using left function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1260&amp;nbsp; Data _null_;&lt;/P&gt;&lt;P&gt;1261&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Temp_Cats;&lt;/P&gt;&lt;P&gt;1262&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("C_" || (_N_), compress(IV_Bin));&lt;/P&gt;&lt;P&gt;1263&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("n_" || (_N_), left(count));&lt;/P&gt;&lt;P&gt;1264&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput ("M", _N_);&lt;/P&gt;&lt;P&gt;1265&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values at the places given by: (Line):(Column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1262:31&amp;nbsp;&amp;nbsp; 1262:46&amp;nbsp;&amp;nbsp; 1263:31&amp;nbsp;&amp;nbsp; 1263:42&amp;nbsp;&amp;nbsp; 1264:27&lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name C_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 must contain only letters, digits,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and underscores.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMPUT at line 1262 column 14.&lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name N_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 must contain only letters, digits,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and underscores.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMPUT at line 1263 column 14.&lt;/P&gt;&lt;P&gt;IV_Bin=1 count=410 _ERROR_=1 _N_=1&lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name C_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 must contain only letters, digits,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and underscores.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMPUT at line 1262 column 14.&lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name N_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 must contain only letters, digits,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and underscores.&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function SYMPUT at line 1263 column 14.&lt;/P&gt;&lt;P&gt;IV_Bin=2 count=35 _ERROR_=1 _N_=2&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: There were 2 observations read from the data set WORK.TEMP_CATS.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 04:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52022#M10960</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-04-01T04:30:47Z</dc:date>
    </item>
    <item>
      <title>How to understand the following call symput in macro?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52023#M10961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;A class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/Linlin" id="jive-306833745916211487803" onmouseout="" onmouseover=""&gt;Linlin&lt;/A&gt;,thanks for your answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Apr 2012 05:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-understand-the-following-call-symput-in-macro/m-p/52023#M10961</guid>
      <dc:creator>bbb_NG</dc:creator>
      <dc:date>2012-04-01T05:38:30Z</dc:date>
    </item>
  </channel>
</rss>

