<?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: Formatting multiple date fields with the same format.  Also formatting with MON-YY. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Formatting-multiple-date-fields-with-the-same-format-Also/m-p/622090#M19710</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; List processing can work for variables with similar names, as shown in #1 example. For #1, the FORMAT statement from the DATA step program is used. I have used a variable list in the FORMAT statement that starts with "date:" (the colon in the FORMAT statement means any variables that start with those 4 characters). Otherwise, you can specify multiple variables to share a format, as shown for #2, where date1 and date3 share the YYMMDD10 format and date2 and date4 share the WORDDATE format:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="simplify_formats.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35841iF5BAA90A1B2EB376/image-size/large?v=v2&amp;amp;px=999" role="button" title="simplify_formats.png" alt="simplify_formats.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need 12 different format statements, although that is the brute force way to get the format used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 01:30:31 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2020-02-04T01:30:31Z</dc:date>
    <item>
      <title>Formatting multiple date fields with the same format.  Also formatting with MON-YY.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-multiple-date-fields-with-the-same-format-Also/m-p/622084#M19708</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;What I am doing here is working however I'm curious if there is a better way...&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I have 12 different "PerioidLabelBuckets" that can all be formatted the same.&amp;nbsp; Currently, I have 12 format statements for each bucket (you can see in my attachment).&amp;nbsp; Is there a way to write one format statement that will take care of all the PeriodLabelBuckets?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I ideally would like the date formatted as mon-yy (DEC-19).&amp;nbsp; Right now the format is monyy. so it shows DEC19.&amp;nbsp; There are examples of how to do this on the SAS community but I'm having a hard time getting understanding how it works and how to apply it to my program.&amp;nbsp; I'm using SAS Enterprise Guide 8.1.&lt;/P&gt;&lt;P&gt;Do i need a proc format statement with EG?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The examples I've seen have proc format;&lt;/P&gt;&lt;P&gt;picture monyyd (default=6)&lt;/P&gt;&lt;P&gt;fmtA = '%b-%y' (datatype=date);&lt;/P&gt;&lt;P&gt;then a data _null_ statement....?&lt;/P&gt;&lt;P&gt;I'm new to SAS and hoping for a little guidance.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 01:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-multiple-date-fields-with-the-same-format-Also/m-p/622084#M19708</guid>
      <dc:creator>LRogers</dc:creator>
      <dc:date>2020-02-04T01:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting multiple date fields with the same format.  Also formatting with MON-YY.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-multiple-date-fields-with-the-same-format-Also/m-p/622090#M19710</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; List processing can work for variables with similar names, as shown in #1 example. For #1, the FORMAT statement from the DATA step program is used. I have used a variable list in the FORMAT statement that starts with "date:" (the colon in the FORMAT statement means any variables that start with those 4 characters). Otherwise, you can specify multiple variables to share a format, as shown for #2, where date1 and date3 share the YYMMDD10 format and date2 and date4 share the WORDDATE format:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="simplify_formats.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35841iF5BAA90A1B2EB376/image-size/large?v=v2&amp;amp;px=999" role="button" title="simplify_formats.png" alt="simplify_formats.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need 12 different format statements, although that is the brute force way to get the format used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 01:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-multiple-date-fields-with-the-same-format-Also/m-p/622090#M19710</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-02-04T01:30:31Z</dc:date>
    </item>
  </channel>
</rss>

