<?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/423244#M104056</link>
    <description>&lt;P&gt;This works fine for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input DATEVAR ddmmyy6.; 
  putlog DATEVAR= date9. DATEVAR= ddmmyys8.;
cards;
160911
151111
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DATEVAR=16SEP2011 DATEVAR=16/09/11&lt;BR /&gt;DATEVAR=15NOV2011 DATEVAR=15/11/11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code runs fine too, so you are doing something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Dec 2017 01:39:11 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-12-22T01:39:11Z</dc:date>
    <item>
      <title>Separate numbers with slash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423243#M104055</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I want to separate the numbers with slashes&lt;/P&gt;&lt;P&gt;the data i have is something like this&amp;nbsp;100287&amp;nbsp;211178&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the suggested solution on other threads, see below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; datevar ddmmyy6&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; datevar ddmmyys8&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;160911
151111&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;however SAS converts it to a SAS date(?) so,&amp;nbsp;&lt;SPAN&gt;100287 becomes&amp;nbsp;300734 then formatting it with slashes it becomes&amp;nbsp;30/07/34, this is incorrect, I want to retain the values but separted only with slashes.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Dec 2017 01:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423243#M104055</guid>
      <dc:creator>SuperSaiyan</dc:creator>
      <dc:date>2017-12-22T01:27:22Z</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/423244#M104056</link>
      <description>&lt;P&gt;This works fine for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input DATEVAR ddmmyy6.; 
  putlog DATEVAR= date9. DATEVAR= ddmmyys8.;
cards;
160911
151111
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DATEVAR=16SEP2011 DATEVAR=16/09/11&lt;BR /&gt;DATEVAR=15NOV2011 DATEVAR=15/11/11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code runs fine too, so you are doing something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 01:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423244#M104056</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-12-22T01:39:11Z</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/423245#M104057</link>
      <description>hello thank you, it worked as expected, but is there any alternative for putlog? It was not taught in my class. is there a way to format it in proc print?</description>
      <pubDate>Fri, 22 Dec 2017 01:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423245#M104057</guid>
      <dc:creator>SuperSaiyan</dc:creator>
      <dc:date>2017-12-22T01:52:34Z</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/423246#M104058</link>
      <description>&lt;P&gt;The code you posted isn't going to run since you didn't put the data on separate lines from the CARDS: statement or the semi-colon that ends it.&amp;nbsp; If we fix that&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input datevar ddmmyy6.;
format datevar ddmmyys8.;
cards;
160911
151111
;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then it looks like it works.&lt;/P&gt;
&lt;PRE&gt;Obs     datevar

 1     16/09/11
 2     15/11/11
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 02:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423246#M104058</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-22T02:08: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/423254#M104062</link>
      <description>&lt;P&gt;Hi Rich Sorry I am new in SAS.Could you please explain me what is the use of putlog? Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 03:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423254#M104062</guid>
      <dc:creator>neha_gupta</dc:creator>
      <dc:date>2017-12-22T03:43:23Z</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/423256#M104063</link>
      <description>Putlog writes in the log.&lt;BR /&gt;&lt;BR /&gt;Use the same format on proc print.</description>
      <pubDate>Fri, 22 Dec 2017 03:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423256#M104063</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-12-22T03:52:11Z</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/423298#M104076</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183530"&gt;@SuperSaiyan&lt;/a&gt; wrote:&lt;BR /&gt;hello thank you, it worked as expected, but is there any alternative for putlog? It was not taught in my class. is there a way to format it in proc print?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Proc print will work with your code out-of-the-box, just test it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input datevar ddmmyy6.;
format datevar ddmmyys8.;
cards;
160911
151111
;
run;

proc print data=want noobs;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only thing I had to correct was the formatting of the cards; block.&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt; datevar

16/09/11
15/11/11
&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Dec 2017 10:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423298#M104076</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-22T10:07:30Z</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/423434#M104132</link>
      <description>&lt;P&gt;put function shows log file at pdv&lt;/P&gt;&lt;P&gt;from source - pdv-ouput&lt;/P&gt;&lt;P&gt;you check&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ravi;

set sashelp.class;

if age=11 then status="chiled";

put  _all_;


run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 07:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separate-numbers-with-slash/m-p/423434#M104132</guid>
      <dc:creator>rvsidhu035</dc:creator>
      <dc:date>2017-12-23T07:21:29Z</dc:date>
    </item>
  </channel>
</rss>

