<?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: Multilabel format for macro date fields in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812191#M320436</link>
    <description>In the monstrosity of the program I created, in some cases, I want the start date of the period, in some I want the full range of the period, and in a few cases, I want the start date for one group and the end date for the other. I have macro variable for labels, and for data selection.&lt;BR /&gt;I am attempting to revise this so it is more explanatory and obvious; it took me something like 9 months to develop the original program and I want to get it revised before I retire.</description>
    <pubDate>Mon, 09 May 2022 15:38:56 GMT</pubDate>
    <dc:creator>BJM</dc:creator>
    <dc:date>2022-05-09T15:38:56Z</dc:date>
    <item>
      <title>Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812178#M320429</link>
      <description>&lt;P&gt;I want to make a multi-label format, feeding in dates.&lt;/P&gt;
&lt;P&gt;I am doing something incorrectly.&lt;/P&gt;
&lt;P&gt;Proc Format Library = Quarter; ** date range (time period) formats **;&lt;BR /&gt;Value Period (Multilabel)&amp;nbsp;&lt;BR /&gt;'04/01/2020'd - '03/31/2021'd = "1"&lt;BR /&gt;'07/01/2020'd - '06/30/2021'd = "2"&lt;BR /&gt;'10/01/2020'd - '09/30/2021'd = "3"&lt;BR /&gt;'01/01/2021'd - '12/31/2021'd = "4" ;&lt;BR /&gt;Run;&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;The log message I get:&lt;/P&gt;
&lt;P&gt;Proc Format Library = Quarter;&lt;BR /&gt;137 Value Period (Multilabel)&amp;nbsp;&lt;BR /&gt;138 '04/01/2020'd - '03/31/2021'd = "1"&lt;BR /&gt;ERROR: Invalid date/time/datetime constant '04/01/2020'd.&lt;BR /&gt;ERROR: ''04/01/2020'D' is not a numeric value.&lt;BR /&gt;139 '07/01/2020'd - '06/30/2021'd = "2"&lt;BR /&gt;140 '10/01/2020'd - '09/30/2021'd = "3"&lt;BR /&gt;141 '01/01/2021'd - '12/31/2021'd = "4" ;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;142 Run;&lt;/P&gt;
&lt;P&gt;What suggestions do you have?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:40:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812178#M320429</guid>
      <dc:creator>BJM</dc:creator>
      <dc:date>2022-05-09T14:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812181#M320430</link>
      <description>&lt;P&gt;SAS Date Constant : "01APR2020"d not "04/01/2020"d&lt;BR /&gt;&lt;BR /&gt;See&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p08kj69i94digfn1sgdhjop08tgh.htm#p05m3p04kafbitn1dry7mrhare4p" target="_self"&gt;Example: Define Date, Time, and Datetime Values in Date Constants&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812181#M320430</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-09T14:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812183#M320431</link>
      <description>I continue to have issues - did I misunderstand?&lt;BR /&gt;Proc Format Library = Quarter;  ** period formats ********************************************************;&lt;BR /&gt;Value Period (Multilabel)      /* update and  run every quarter */&lt;BR /&gt;  '01APR2020'd=(mmddyy10.) - '30MAR2021'd=(mmddyy10.) = '1'&lt;BR /&gt;  '01Jul2020'd=(mmddyy10.) - '30JUN2021'd=(mmddyy10.) = '2'&lt;BR /&gt;  '01Oct2020'd=(mmddyy10.) - '30SEP2021'd=(mmddyy10.) = '3'&lt;BR /&gt;  '01Jan2021'd=(mmddyy10.) - '31DEC2021'd=(mmddyy10.) = '4'  ;&lt;BR /&gt;Run;&lt;BR /&gt;;&lt;BR /&gt;Value Period (Multilabel)      /* update and  run every quarter */&lt;BR /&gt;222    '01APR2020'd=(mmddyy10.) - '30MAR2021'd=(mmddyy10.) = '1'&lt;BR /&gt;                    -&lt;BR /&gt;                    22&lt;BR /&gt;                    76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a format name.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;223    '01Jul2020'd=(mmddyy10.) - '30JUN2021'd=(mmddyy10.) = '2'&lt;BR /&gt;224    '01Oct2020'd=(mmddyy10.) - '30SEP2021'd=(mmddyy10.) = '3'&lt;BR /&gt;225    '01Jan2021'd=(mmddyy10.) - '31DEC2021'd=(mmddyy10.) = '4'  ;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;226  R&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 15:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812183#M320431</guid>
      <dc:creator>BJM</dc:creator>
      <dc:date>2022-05-09T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812186#M320433</link>
      <description>&lt;P&gt;This isn't what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226241"&gt;@AMSAS&lt;/a&gt;&amp;nbsp;said&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'01APR2020'd - '30MAR2021'd = '1'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or if I may be so bold as to recommend an improvement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'01APR2020'd - '30MAR2021'd = '01APR2020 - 30MAR2021'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so that when the format is used, everyone knows which 12 months this is referring to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35217"&gt;@BJM&lt;/a&gt;&amp;nbsp;from now, show us the &lt;FONT color="#FF0000"&gt;ENTIRE&lt;/FONT&gt; log for a PROC or DATA step that has an error, instead of selecting parts of the log to show us. Please copy the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; log for this PROC (or this DATA step) as text and paste it into the window that appears when you click on on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66123iA4EF494F9CA0F6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 15:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812186#M320433</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-09T15:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812189#M320434</link>
      <description>&lt;P&gt;Hi Paige&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;OK. so, I did misunderstand.&lt;/P&gt;
&lt;P&gt;The periods are numbered 1 - 4 which is why I have them labeled that.&lt;/P&gt;
&lt;P&gt;The current program summarizes by each period separately and I have to regroup them during the program. If I can get the multilabel format to work correctly, I should be able to use Proc Summary with the multilabel format.&lt;/P&gt;
&lt;P&gt;I am hoping to revise my program to run a quarterly report using the multilabel formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, now it works:&lt;/P&gt;
&lt;P&gt;228 Proc Format Library = Quarter;&lt;BR /&gt;229 Value Period (Multilabel)&lt;BR /&gt;230 '01APR2020'd - '30MAR2021'd='1'&lt;BR /&gt;231 '01Jul2020'd - '30JUN2021'd='2'&lt;BR /&gt;232 '01Oct2020'd - '30SEP2021'd='3'&lt;BR /&gt;233 '01Jan2021'd - '31DEC2021'd='4' ;&lt;BR /&gt;NOTE: Format PERIOD has been written to QUARTER.FORMATS.&lt;BR /&gt;234 Run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 15:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812189#M320434</guid>
      <dc:creator>BJM</dc:creator>
      <dc:date>2022-05-09T15:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812190#M320435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35217"&gt;@BJM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Paige&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;OK. so, I did misunderstand.&lt;/P&gt;
&lt;P&gt;The periods are numbered 1 - 4 which is why I have them labeled that.&lt;/P&gt;
&lt;P&gt;The current program summarizes by each period separately and I have to regroup them during the program. If I can get the multilabel format to work correctly, I should be able to use Proc Summary with the multilabel format.&lt;/P&gt;
&lt;P&gt;I am hoping to revise my program to run a quarterly report using the multilabel formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If it is the case in your company or university where EVERYONE understands that period 1 is 01APR2020 to 30MAR2021, then you can use the value of '1'. But usually that's not the case. One of the major benefits of custom formats is that you can make the format appear as something people will understand, such as '01APR2020-30MAR2021' which more understandable than '1'. And anyway, one of the ideas of designing output that will be clear and understandable to people is to label and format things clearly. To me '1' is not a clear format for this data.&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 15:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812190#M320435</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-09T15:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multilabel format for macro date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812191#M320436</link>
      <description>In the monstrosity of the program I created, in some cases, I want the start date of the period, in some I want the full range of the period, and in a few cases, I want the start date for one group and the end date for the other. I have macro variable for labels, and for data selection.&lt;BR /&gt;I am attempting to revise this so it is more explanatory and obvious; it took me something like 9 months to develop the original program and I want to get it revised before I retire.</description>
      <pubDate>Mon, 09 May 2022 15:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multilabel-format-for-macro-date-fields/m-p/812191#M320436</guid>
      <dc:creator>BJM</dc:creator>
      <dc:date>2022-05-09T15:38:56Z</dc:date>
    </item>
  </channel>
</rss>

