<?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 How to use datepart and format in date9. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432141#M106980</link>
    <description>&lt;P&gt;I've been using this data step to try and get the date from a datetime format (SELLSTARTDATE):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sorted_table (keep= productid color SELLSTARTDATE);&lt;BR /&gt;set sorted;&lt;BR /&gt;SELLSTART=datepart(SELLSTARTDATE);&lt;BR /&gt;format SELLSTART date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not create a SELLSTART column or format it in date9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 11:47:34 GMT</pubDate>
    <dc:creator>graham114</dc:creator>
    <dc:date>2018-01-30T11:47:34Z</dc:date>
    <item>
      <title>How to use datepart and format in date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432141#M106980</link>
      <description>&lt;P&gt;I've been using this data step to try and get the date from a datetime format (SELLSTARTDATE):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sorted_table (keep= productid color SELLSTARTDATE);&lt;BR /&gt;set sorted;&lt;BR /&gt;SELLSTART=datepart(SELLSTARTDATE);&lt;BR /&gt;format SELLSTART date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not create a SELLSTART column or format it in date9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 11:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432141#M106980</guid>
      <dc:creator>graham114</dc:creator>
      <dc:date>2018-01-30T11:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use datepart and format in date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432144#M106982</link>
      <description>&lt;P&gt;On your keep= line you do not specify to keep sellstart, hence its not in the output dataset.&amp;nbsp; Also avoid coding in captials it really makes reading code harder.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 11:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432144#M106982</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-30T11:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use datepart and format in date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432145#M106983</link>
      <description>&lt;P&gt;You put KEEP= in the wrong place.&amp;nbsp; It belongs on the SET statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data sorted_table;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set sorted (keep=product color SELLSTARTDATE);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;While KEEP= can be used in either place, it belongs on the SET statement for this particular DATA step.&amp;nbsp; On the DATA statement, it limits the variables that become part of the new data set.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 12:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-datepart-and-format-in-date9/m-p/432145#M106983</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-30T12:00:11Z</dc:date>
    </item>
  </channel>
</rss>

