<?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: Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590823#M169152</link>
    <description>&lt;P&gt;I think of two ways. One is to use SCAN() function and another is to assign to a string of length 8 (under assumption that 'T' precedes 8 characters).&lt;/P&gt;
&lt;P&gt;The first is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input x $20.;
length y $8.;
y = scan(x, 1, 'T');
put y =;
datalines;
20190909T080000+0000
20190909T081222+0000
20190909T081222+0000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input x $20.;
length y $8.;
y = x;
put y=;
datalines;
20190909T080000+0000
20190909T081222+0000
20190909T081222+0000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 04:19:16 GMT</pubDate>
    <dc:creator>KachiM</dc:creator>
    <dc:date>2019-09-23T04:19:16Z</dc:date>
    <item>
      <title>Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590816#M169148</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have this variable whit these observations:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Date_time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20190909T080000+0000&lt;/P&gt;&lt;P&gt;20190909T081222+0000&lt;/P&gt;&lt;P&gt;20190909T081222+0000&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't need the letter T and whatever is after it. I just need what is before it and keep it as a date (here 09/09/2019). The current format is&amp;nbsp;B8601DZ35.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Anyone can help me with that? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 03:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590816#M169148</guid>
      <dc:creator>Antoine44</dc:creator>
      <dc:date>2019-09-23T03:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590823#M169152</link>
      <description>&lt;P&gt;I think of two ways. One is to use SCAN() function and another is to assign to a string of length 8 (under assumption that 'T' precedes 8 characters).&lt;/P&gt;
&lt;P&gt;The first is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input x $20.;
length y $8.;
y = scan(x, 1, 'T');
put y =;
datalines;
20190909T080000+0000
20190909T081222+0000
20190909T081222+0000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input x $20.;
length y $8.;
y = x;
put y=;
datalines;
20190909T080000+0000
20190909T081222+0000
20190909T081222+0000
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 04:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590823#M169152</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-09-23T04:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590824#M169153</link>
      <description>&lt;P&gt;Thanks for your help! I'll try that&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 04:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590824#M169153</guid>
      <dc:creator>Antoine44</dc:creator>
      <dc:date>2019-09-23T04:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590828#M169155</link>
      <description>&lt;P&gt;If you variable type is character then you can use SCAN().&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your variable type is numeric with a date time format, then you want to use DATEPART().&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273810"&gt;@Antoine44&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I currently have this variable whit these observations:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Date_time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20190909T080000+0000&lt;/P&gt;
&lt;P&gt;20190909T081222+0000&lt;/P&gt;
&lt;P&gt;20190909T081222+0000&lt;/P&gt;
&lt;P&gt;etc..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't need the letter T and whatever is after it. I just need what is before it and keep it as a date (here 09/09/2019). The current format is&amp;nbsp;B8601DZ35.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Anyone can help me with that? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 04:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590828#M169155</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-23T04:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590863#M169170</link>
      <description>Since your new variable is supposed to be a date:&lt;BR /&gt;&lt;BR /&gt;newvar = input(oldvar, yymmdd8.) ;&lt;BR /&gt;format newvar mmddyys10.;</description>
      <pubDate>Mon, 23 Sep 2019 10:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590863#M169170</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-09-23T10:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590884#M169180</link>
      <description>&lt;P&gt;If the variable has the&amp;nbsp;&lt;SPAN&gt;B8601DZ35. format attached to it then it must be a numeric variable that contains datetime values (number of seconds since 1960).&amp;nbsp; You could just attach a different format so that it only prints the date. For example you could use the DTDATE9. format.&amp;nbsp; Or you could extract just the date value (number of days since 1960) using the DATEPART() function and then attach any of the many formats that can display date values, for example DATE9. or YYMMDD10..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format/m-p/590884#M169180</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-23T12:32:18Z</dc:date>
    </item>
  </channel>
</rss>

