<?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 create all months in the SAS report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327996#M73220</link>
    <description>Thank you very much for giving solution.</description>
    <pubDate>Fri, 27 Jan 2017 12:08:12 GMT</pubDate>
    <dc:creator>chanduk</dc:creator>
    <dc:date>2017-01-27T12:08:12Z</dc:date>
    <item>
      <title>How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327932#M73197</link>
      <description>&lt;P&gt;I have a data set which contains Month,avg_days_open variables . In month variable there is 1 and 11 month values are there . I would like to display in the report for &amp;nbsp;1 and 11 months avg_days_open are 60 ,70 and for the remaining months ( 2,3,4,5,6,7,8,9,10,12) should be &lt;SPAN&gt;avg_days_open are&amp;nbsp;&lt;/SPAN&gt;0 in the report. How we can write the sas code for this requirement ( There is no month values&amp;nbsp;&lt;SPAN&gt;2,3,4,5,6,7,8,9,10,12 in the data set but should display in the report)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 05:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327932#M73197</guid>
      <dc:creator>chanduk</dc:creator>
      <dc:date>2017-01-27T05:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327936#M73198</link>
      <description>&lt;P&gt;What kind Report? What does your code look like so far?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Search: PRELOADFMT&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 07:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327936#M73198</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-27T07:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327940#M73199</link>
      <description>&lt;P&gt;I am generating report using proc report. The report should be like below.&lt;/P&gt;&lt;P&gt;Month &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Average_Days_open&lt;/P&gt;&lt;P&gt;January 2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60&lt;/P&gt;&lt;P&gt;February 2016 &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;-----&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;July 2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;August 2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;November 2016 &amp;nbsp; &amp;nbsp;70&lt;/P&gt;&lt;P&gt;December 2016 &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data in the final dataset for &amp;nbsp;January 2016 &amp;amp; November 2016 and remaing months data don't have in the data set. How to add the remaining months(February2016 ,March 2016..............) to the final data set and the values(&lt;SPAN&gt;Average_Days_open)&amp;nbsp;&lt;/SPAN&gt; should be 0 &amp;nbsp;in the report? My final data set contains variables like Month,&lt;SPAN&gt;Average_Days_open&lt;/SPAN&gt;&amp;nbsp;. Please let me know if you have any questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;chandu&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 07:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327940#M73199</guid>
      <dc:creator>chanduk</dc:creator>
      <dc:date>2017-01-27T07:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327942#M73200</link>
      <description>I am generating report using proc report. The report should be like below.&lt;BR /&gt;Month Average_Days_open&lt;BR /&gt;January 2016 60&lt;BR /&gt;February 2016 0&lt;BR /&gt;-----&lt;BR /&gt;----&lt;BR /&gt;July 2016 0&lt;BR /&gt;August 2016 0&lt;BR /&gt;........&lt;BR /&gt;----&lt;BR /&gt;November 2016 70&lt;BR /&gt;December 2016 0&lt;BR /&gt;&lt;BR /&gt;I have a data in the final dataset for January 2016 &amp;amp; November 2016 and remaing months data don't have in the data set. How to add the remaining months(February2016 ,March 2016..............) to the final data set and the values(Average_Days_open) should be 0 in the report? My final data set contains variables like Month,Average_Days_open . Please let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;chandu</description>
      <pubDate>Fri, 27 Jan 2017 07:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327942#M73200</guid>
      <dc:creator>chanduk</dc:creator>
      <dc:date>2017-01-27T07:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327951#M73203</link>
      <description>&lt;P&gt;Post test data, in the form of a dataset of what you have. &amp;nbsp;And post and example of what you wan that test data output to look like. &amp;nbsp;It should be simply a loop and output control in a datastep before your report - just guessing your data here as you have not posted it:&lt;/P&gt;
&lt;PRE&gt;data have;
  month_yr="January 2016"; res=70; output;
  month_yr="November 2016"; res=9; output;
run;

data want (drop=i);
  set have;
  if month_yr="January 2016" then do;
    output;
    do i="Febuary","March","April","May","June","July","August","September";
      month_yr=catx(" ",i,"2016");
      res=0;
      output;
    end;
  end;
  else output;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 09:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327951#M73203</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-27T09:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327975#M73217</link>
      <description>Thanks for providing quick answer. One samll change. In our reporting the financial year starts from July to June. I would like the report should be like below&lt;BR /&gt;Month Average Days Open&lt;BR /&gt;July 2015 0&lt;BR /&gt;August 2015 0&lt;BR /&gt;September 2015 0&lt;BR /&gt;october 2015 0&lt;BR /&gt;November 2015 70&lt;BR /&gt;December 2015 0&lt;BR /&gt;January 2016 60&lt;BR /&gt;February 2016 0&lt;BR /&gt;------&lt;BR /&gt;------&lt;BR /&gt;June 2016 0&lt;BR /&gt;&lt;BR /&gt;Please provide solution for this and also please remember the data set data also will change periodically ( For one month run having 1 &amp;amp; 11 months have data and another month run the data set having 2 &amp;amp; 10 months data .This time the remaing months values (avg_day_open) should be 0.)</description>
      <pubDate>Fri, 27 Jan 2017 10:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327975#M73217</guid>
      <dc:creator>chanduk</dc:creator>
      <dc:date>2017-01-27T10:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327978#M73218</link>
      <description>&lt;P&gt;Slightly different method then. &amp;nbsp;You create a template dataset which contains your year, then merge on the data that you actually have. &amp;nbsp;That way the template doesn't change. but the merging of different months each time does:&lt;/P&gt;
&lt;PRE&gt;data template;
  length month_yr $20;
  do month_yr="July","August","September","October","November","December","January","Febuary","March","April","May","June";
    month_yr=catx(" ",month_yr,"2016");
    output;
  end;
run;

data have;
  month_yr="September 2016"; value=90; output;
  month_yr="January 2016"; value=40; output;
run;

proc sql;
  create table WANT as
  select  A.MONTH_YR,
          coalesce(B.VALUE,0) as VALUE
  from    TEMPLATE A
  left join HAVE B
  on      A.MONTH_YR=B.MONTH_YR;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327978#M73218</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-27T11:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327996#M73220</link>
      <description>Thank you very much for giving solution.</description>
      <pubDate>Fri, 27 Jan 2017 12:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/327996#M73220</guid>
      <dc:creator>chanduk</dc:creator>
      <dc:date>2017-01-27T12:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/328305#M73289</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125748"&gt;@chanduk&lt;/a&gt;&amp;nbsp;Please make sure to mark the appropriate response as the correct answer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 00:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/328305#M73289</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-30T00:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create all months in the SAS report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/328312#M73296</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125748"&gt;@chanduk&lt;/a&gt;&amp;nbsp;You should mark&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;solution as correct, not my request to choose a correct solution!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 01:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-all-months-in-the-SAS-report/m-p/328312#M73296</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-30T01:27:46Z</dc:date>
    </item>
  </channel>
</rss>

