<?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: arrays for months in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850598#M336155</link>
    <description>&lt;P&gt;Not clear what you want to achieve. Please post data in usable form and show the expected output.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 11:17:57 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-12-21T11:17:57Z</dc:date>
    <item>
      <title>arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850596#M336153</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data months;
array months(12) $ jan -- dec;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;1. How to create months January to December&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 11:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850596#M336153</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-12-21T11:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850597#M336154</link>
      <description>&lt;P&gt;Better to keep data in a long format and work with it that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want a report, use PROC REPORT on the long format data. PROC REPORT can produce columns with whatever names you want from the long format data. We can provide examples.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 11:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850597#M336154</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-21T11:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850598#M336155</link>
      <description>&lt;P&gt;Not clear what you want to achieve. Please post data in usable form and show the expected output.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 11:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850598#M336155</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-12-21T11:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850599#M336156</link>
      <description>&lt;P&gt;There is no real shortcut like the posted pseudo code. You have to spell them out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   array month{*} January February March April May June July August September October November December;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 11:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850599#M336156</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-12-21T11:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850648#M336173</link>
      <description>&lt;P&gt;You need to type all the twelve month names.&lt;BR /&gt;jan --dec or January -- December&amp;nbsp; won't work.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 17:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850648#M336173</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2022-12-21T17:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850682#M336181</link>
      <description>&lt;P&gt;You will make your coding a lot easier if you name your months like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data months;
array months(12) $ month1 - month12;
do i = 1 to 12;
  year_array + months(i);
run;
year_sum = sum(of month1 - month12);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can always label the month variables as Jan, Feb etc.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 21:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850682#M336181</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-21T21:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850713#M336190</link>
      <description>&lt;P&gt;Do not keep data (dates) in structure (variable names). Use a long dataset layout where date values are stored as such, with a display format as needed.&lt;/P&gt;
&lt;P&gt;A wide layout for reporting purposes can always be created easily with procedures like REPORT or TABULATE.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 05:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850713#M336190</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-22T05:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: arrays for months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850768#M336206</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have a lot of suggestions, but the real problem is that you want a wide data set, rather than a long data set from which you create a wide report, as both&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and I have pointed out. Working with the long data set eliminates most of the problems doing this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a simple example of how using a long data set, rather than a wide data set, still results in a wide report. The programming is simple when you do it this way.&amp;nbsp;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/format-all-column-names-that-are-similar/m-p/682619#M24419" target="_blank" rel="noopener"&gt;Solved: Re: format all column names that are similar - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example, where the wanted columns are months, SAS provides many formats so that you can make the columns in PROC REPORT have meaningful column headings (such as Jan, Feb, &lt;EM&gt;etc&lt;/EM&gt;.) without you actually having to type them in yourself.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 12:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-for-months/m-p/850768#M336206</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-22T12:43:07Z</dc:date>
    </item>
  </channel>
</rss>

