<?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: Change Variable Data Type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-Data-Type/m-p/375256#M89932</link>
    <description>&lt;P&gt;Of what, the DATUM variable? &amp;nbsp;If so then input() is the one you want:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table QUERY as
  select  input(DATUM,yymmdd10.) as DATE,
          MENGE
  from    DEMAND.DMAND
  order by DATE;
quit;&lt;/PRE&gt;
&lt;P&gt;You cannot change the type of a variable, you need to create a new variable - which is what the select as is actually doing behind the scene.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2017 10:11:43 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-07-12T10:11:43Z</dc:date>
    <item>
      <title>Change Variable Data Type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-Data-Type/m-p/375252#M89930</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to change the variable type from Char to Num.&lt;/P&gt;&lt;P&gt;How is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.query AS&lt;BR /&gt;SELECT Datum , Menge FROM DEMAND.DEMAND ORDER BY sortkey(Datum, "de");&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;PROC DATASETS NOLIST NODETAILS;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=WORK.details;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;Data&amp;nbsp; DEMAND.DEMAND;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 09:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-Data-Type/m-p/375252#M89930</guid>
      <dc:creator>MrAn</dc:creator>
      <dc:date>2017-07-12T09:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable Data Type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-Data-Type/m-p/375256#M89932</link>
      <description>&lt;P&gt;Of what, the DATUM variable? &amp;nbsp;If so then input() is the one you want:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table QUERY as
  select  input(DATUM,yymmdd10.) as DATE,
          MENGE
  from    DEMAND.DMAND
  order by DATE;
quit;&lt;/PRE&gt;
&lt;P&gt;You cannot change the type of a variable, you need to create a new variable - which is what the select as is actually doing behind the scene.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 10:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-Data-Type/m-p/375256#M89932</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-12T10:11:43Z</dc:date>
    </item>
  </channel>
</rss>

