<?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: CALL SYMPUT macro variable no resolving correctly in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544637#M7898</link>
    <description>Hi:&lt;BR /&gt;  I don't understand what you mean by "the number isn't printing in the data set" -- do you want to see the values in the resolved code? Have you turned on the MPRINT and SYMBOLGEN options?&lt;BR /&gt;&lt;BR /&gt;  Without data, no one can test your code.&lt;BR /&gt;  &lt;BR /&gt;Cynthia</description>
    <pubDate>Wed, 20 Mar 2019 16:36:38 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-03-20T16:36:38Z</dc:date>
    <item>
      <title>CALL SYMPUT macro variable no resolving correctly</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544586#M7886</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to figure out why a macro variable is not resolving correctly when I use call symput.&lt;/P&gt;&lt;P&gt;Here is how I define the macro variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cross2;
	set cross crossb2;
	if &amp;amp;domain. = 1 and missing(&amp;amp;by.) and F_&amp;amp;by. = "Total" and F_&amp;amp;var. = "Total" then do;
		&amp;amp;by.=99;
		scale=WgtFreq/Frequency;
		call symput("scale",scale);
	end;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is how I want to use the macro variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cross3(keep=&amp;amp;by. VarLabel NMISS Scale Mean stderr min max);
	set cross2;
	if &amp;amp;domain. = 1 then output;
	scale=&amp;amp;scale.;
	WgtNMISS = &amp;amp;scale.*NMISS;
run;
%put &amp;amp;=scale;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run the above code, I am getting a missing value for scale in a data set print out, but the log print out of the variable shows it resolved to a number.&lt;/P&gt;&lt;P&gt;Any idea why the number isn't printing in the data set?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 14:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544586#M7886</guid>
      <dc:creator>Alchemy1ndex</dc:creator>
      <dc:date>2019-03-20T14:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUT macro variable no resolving correctly</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544633#M7896</link>
      <description>&lt;P&gt;When you use an explicit output such as :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cross3(keep=&amp;amp;by. VarLabel NMISS Scale Mean stderr min max);
	set cross2;
	if &amp;amp;domain. = 1 then output;
	scale=&amp;amp;scale.;
	WgtNMISS = &amp;amp;scale.*NMISS;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then unless there is another output statement nothing calculated or manipulated after the first output will be in the output data set because you did not tell SAS you wanted it output. The variables will be there with missing values.&lt;/P&gt;
&lt;P&gt;If you only want to process data where &amp;amp;domain variable =1 then use&lt;/P&gt;
&lt;P&gt;Where &amp;amp;domain=1;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;If &amp;amp;domain=1;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 16:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544633#M7896</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-20T16:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUT macro variable no resolving correctly</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544637#M7898</link>
      <description>Hi:&lt;BR /&gt;  I don't understand what you mean by "the number isn't printing in the data set" -- do you want to see the values in the resolved code? Have you turned on the MPRINT and SYMBOLGEN options?&lt;BR /&gt;&lt;BR /&gt;  Without data, no one can test your code.&lt;BR /&gt;  &lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 20 Mar 2019 16:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544637#M7898</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-20T16:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUT macro variable no resolving correctly</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544796#M7935</link>
      <description>&lt;P&gt;I don't understand why there are two steps at all. Can you show what's inside of the datasets cross and crossb2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems as you are trying to replace/calculate scale/WgtMiss using the values found in a total-obeservation. There are easier ways to do this, eg. merging the total-observation with detail obs. But to provide code, i need to have data to work with.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 10:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544796#M7935</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-21T10:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUT macro variable no resolving correctly</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544824#M7940</link>
      <description>&lt;P&gt;ballardw, you nailed it!&lt;/P&gt;&lt;P&gt;This was my issue all along. I am working with someone else's code and didn't realize that they had put the output statement in there. Not sure why they did, it is completely unnecessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 12:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CALL-SYMPUT-macro-variable-no-resolving-correctly/m-p/544824#M7940</guid>
      <dc:creator>Alchemy1ndex</dc:creator>
      <dc:date>2019-03-21T12:08:53Z</dc:date>
    </item>
  </channel>
</rss>

