<?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: Separate numbers with slash in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373908#M89466</link>
    <description>&lt;P&gt;Then do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input datevar ddmmyy6.;
format datevar ddmmyys8.;
cards;
160911
151111
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Jul 2017 11:41:15 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-07-07T11:41:15Z</dc:date>
    <item>
      <title>Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373900#M89462</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a csv file which has a date variable with values like 160911, 151111.&lt;/P&gt;&lt;P&gt;I want to separate this date with either slash or hyphen like 16/09/11 and 15/11/11.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373900#M89462</guid>
      <dc:creator>india2016</dc:creator>
      <dc:date>2017-07-07T11:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373903#M89463</link>
      <description>&lt;P&gt;What is the sequence? YYMMDD, DDMMYY or MMDDYY?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373903#M89463</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-07T11:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373904#M89464</link>
      <description>&lt;P&gt;Very little information of what you really want to do &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Do you want to read the file into sas and convert the date, do you want to change the file i.e write back the converted date.&lt;/P&gt;
&lt;P&gt;Why do you want to insert / into the date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyhow, this little step adds / to the new variable outdate by reading the variable indate &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; indate $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; outdate $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; indate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; outdate = cats(substr(indate,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,substr(indate,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'/'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,substr(indate,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;160911&lt;/P&gt;
&lt;P&gt;151111&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Fredrik&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373904#M89464</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2017-07-07T11:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373906#M89465</link>
      <description>sequence is ddmmyy</description>
      <pubDate>Fri, 07 Jul 2017 11:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373906#M89465</guid>
      <dc:creator>india2016</dc:creator>
      <dc:date>2017-07-07T11:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373908#M89466</link>
      <description>&lt;P&gt;Then do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input datevar ddmmyy6.;
format datevar ddmmyys8.;
cards;
160911
151111
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373908#M89466</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-07T11:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373924#M89474</link>
      <description>Thanks it worked.</description>
      <pubDate>Fri, 07 Jul 2017 12:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/373924#M89474</guid>
      <dc:creator>india2016</dc:creator>
      <dc:date>2017-07-07T12:00:24Z</dc:date>
    </item>
  </channel>
</rss>

