<?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: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523361#M4601</link>
    <description>Thanks so much! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I was really looking forward to something like this! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I love the way I learn things here!</description>
    <pubDate>Mon, 24 Dec 2018 09:02:10 GMT</pubDate>
    <dc:creator>d6k5d3</dc:creator>
    <dc:date>2018-12-24T09:02:10Z</dc:date>
    <item>
      <title>WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523337#M4589</link>
      <description>&lt;P&gt;The following code snippet is giving me the following NOTE and ERROR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NOTE: Table has been opened in browse mode.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR: Asterisks are an indication of a format width problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro cb_summary (cur, reg, code);

proc means data= &amp;amp;cur._c_&amp;amp;reg._&amp;amp;code. noprint;
class Event;
output out= S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
run;

data S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
set S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;

if _TYPE_= 1;
run;

%if &amp;amp;code.= 1 %then %do;
proc means data= &amp;amp;cur._c_&amp;amp;reg._&amp;amp;code. noprint;
class Event Year;
output out= YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
run;

data YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
set YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;

if _TYPE_= 3;
run;
%end;

%mend cb_summary;

%cb_summary (HUF, HUN, 1);
%cb_summary (HUF, HUN, 2);
%cb_summary (HUF, US, 1);
%cb_summary (HUF, US, 2);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;W&lt;SPAN&gt;hile the above code snippet gives the NOTE and ERROR in log, the following does not:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro eco_summary (cur, reg);

proc means data= &amp;amp;cur._E_&amp;amp;reg. noprint;
class Event;
output out= S&amp;amp;cur._E_&amp;amp;reg.;
run;

data S&amp;amp;cur._E_&amp;amp;reg.;
set S&amp;amp;cur._E_&amp;amp;reg.;

if _TYPE_= 1;
run;

proc means data= &amp;amp;cur._E_&amp;amp;reg. noprint;
class Event Year;
output out= YS&amp;amp;cur._E_&amp;amp;reg.;
run;

data YS&amp;amp;cur._E_&amp;amp;reg.;
set YS&amp;amp;cur._E_&amp;amp;reg.;

if _TYPE_= 3;
run;

%mend eco_summary;

%eco_summary (HUF, HUN);
%eco_summary (HUF, US);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I am sorry I fail to figure out. Need help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Much thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 20:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523337#M4589</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-23T20:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523340#M4592</link>
      <description>No idea really. &lt;BR /&gt;While debugging macro options symbolgen MPRINT mlogic is your friends.&lt;BR /&gt;Can it be a locking issue, like you run in EG and result opens automatically.</description>
      <pubDate>Sun, 23 Dec 2018 22:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523340#M4592</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-12-23T22:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523343#M4594</link>
      <description>&lt;P&gt;do you have the %if test outside of a datastep?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 23:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523343#M4594</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-12-23T23:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523346#M4596</link>
      <description>&lt;P&gt;Regardless of what the answer turns out to be, you should learn the NWAY option on the PROC MEANS statement.&amp;nbsp; The output data set would contain only the most detailed level of summarization automatically, and you would not need the DATA step that follows either PROC MEANS.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 01:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523346#M4596</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-24T01:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523360#M4600</link>
      <description>It's right before a PROC MEANS step.</description>
      <pubDate>Mon, 24 Dec 2018 09:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523360#M4600</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-24T09:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523361#M4601</link>
      <description>Thanks so much! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I was really looking forward to something like this! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I love the way I learn things here!</description>
      <pubDate>Mon, 24 Dec 2018 09:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523361#M4601</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-24T09:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523370#M4603</link>
      <description>&lt;P&gt;Can you post the full log ?&lt;/P&gt;
&lt;P&gt;Regarding the ERROR "&lt;SPAN&gt;&lt;STRONG&gt;ERROR: Asterisks are an indication of a format width problem&lt;/STRONG&gt;.&lt;/SPAN&gt;" -&lt;/P&gt;
&lt;P&gt;1) Which dataset and which variablr does it relate to ?&lt;/P&gt;
&lt;P&gt;2) Open that (or look for) dataset where variable is shown as '******' instead of a valid numeric value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; That variable is assigned with too short format, for example run next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
     num=123456;
    format num 4.;&lt;BR /&gt;    put num=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; maybe the asterisk relates to a summary that needs more positions than any value summed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
    num1 = 27;
    num2 = 36;
    num3 = 59;
    
    sum = sum(num1, num2, num3);
    put sum 2.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 11:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523370#M4603</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-12-24T11:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523373#M4604</link>
      <description>I think I should have mentioned this earlier. I apologize. The NOTE and ERROR that I receive in the log appears only after I double-click the result datsets to view them.</description>
      <pubDate>Mon, 24 Dec 2018 12:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523373#M4604</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-24T12:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523390#M4605</link>
      <description>&lt;P&gt;The log for your reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1062  %macro cb_summary (cur, reg, code);
1063
1064  proc means data= &amp;amp;cur._c_&amp;amp;reg._&amp;amp;code. nway noprint;
1065  class Event;
1066  output out= S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1067  run;
1068
1069  /*data S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1070  set S&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1071
1072  if _TYPE_= 1;
1073  run;*/
1074
1075  %if &amp;amp;code.= 1 %then %do;
1076  proc means data= &amp;amp;cur._c_&amp;amp;reg._&amp;amp;code. nway noprint;
1077  class Event Year;
1078  output out= YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1079  run;
1080
1081  /*data YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1082  set YS&amp;amp;cur._c_&amp;amp;reg._&amp;amp;code.;
1083
1084  if _TYPE_= 3;
1085  run;*/
1086  %end;
1087
1088  %mend cb_summary;
1089
1090  options mprint;
1091
1092  %cb_summary (HUF, HUN, 1);
MPRINT(CB_SUMMARY):   proc means data= HUF_c_HUN_1 nway noprint;
MPRINT(CB_SUMMARY):   class Event;
MPRINT(CB_SUMMARY):   output out= SHUF_c_HUN_1;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_HUN_1.
NOTE: The data set WORK.SHUF_C_HUN_1 has 5 observations and 28 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.83 seconds
      cpu time            0.39 seconds


MPRINT(CB_SUMMARY):   proc means data= HUF_c_HUN_1 nway noprint;
MPRINT(CB_SUMMARY):   class Event Year;
MPRINT(CB_SUMMARY):   output out= YSHUF_c_HUN_1;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_HUN_1.
NOTE: The data set WORK.YSHUF_C_HUN_1 has 60 observations and 28 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.37 seconds
      cpu time            0.46 seconds


1093  %cb_summary (HUF, HUN, 2);
MPRINT(CB_SUMMARY):   proc means data= HUF_c_HUN_2 nway noprint;
MPRINT(CB_SUMMARY):   class Event;
MPRINT(CB_SUMMARY):   output out= SHUF_c_HUN_2;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_HUN_2.
NOTE: The data set WORK.SHUF_C_HUN_2 has 10 observations and 16 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.56 seconds
      cpu time            0.28 seconds


1094  %cb_summary (HUF, US, 1);
MPRINT(CB_SUMMARY):   proc means data= HUF_c_US_1 nway noprint;
MPRINT(CB_SUMMARY):   class Event;
MPRINT(CB_SUMMARY):   output out= SHUF_c_US_1;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_US_1.
NOTE: The data set WORK.SHUF_C_US_1 has 10 observations and 29 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.83 seconds
      cpu time            0.36 seconds


MPRINT(CB_SUMMARY):   proc means data= HUF_c_US_1 nway noprint;
MPRINT(CB_SUMMARY):   class Event Year;
MPRINT(CB_SUMMARY):   output out= YSHUF_c_US_1;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_US_1.
NOTE: The data set WORK.YSHUF_C_US_1 has 70 observations and 29 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.38 seconds
      cpu time            0.45 seconds


1095  %cb_summary (HUF, US, 2);
MPRINT(CB_SUMMARY):   proc means data= HUF_c_US_2 nway noprint;
MPRINT(CB_SUMMARY):   class Event;
MPRINT(CB_SUMMARY):   output out= SHUF_c_US_2;
MPRINT(CB_SUMMARY):   run;

NOTE: There were 841896 observations read from the data set WORK.HUF_C_US_2.
NOTE: The data set WORK.SHUF_C_US_2 has 10 observations and 16 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.55 seconds
      cpu time            0.28 seconds



NOTE: Table has been opened in browse mode.
ERROR: Asterisks are an indication of a format width problem.
ERROR: Asterisks are an indication of a format width problem.
ERROR: Asterisks are an indication of a format width problem.
ERROR: Asterisks are an indication of a format width problem.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Dec 2018 12:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523390#M4605</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2018-12-24T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: WHAT IS WRONG WITH THIS CODE? I FAIL TO FIGURE OUT.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523398#M4609</link>
      <description>&lt;P&gt;Mainly there is no error in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can eliminate the error-note either by changing the format in your input datasets of the related variables or&lt;/P&gt;
&lt;P&gt;by adding a format statement in the proc means:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; proc means ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;class ... ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var .....;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output .... ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FORMAT &amp;lt;variables&amp;gt; &amp;lt;wide enough format. &amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 14:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/WHAT-IS-WRONG-WITH-THIS-CODE-I-FAIL-TO-FIGURE-OUT/m-p/523398#M4609</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-12-24T14:02:46Z</dc:date>
    </item>
  </channel>
</rss>

