<?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: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824691#M35182</link>
    <description>&lt;P&gt;You do NOT want to store dates in character variables in SAS. Convert the character strings to numeric date values, and apply a suitable format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
chardate = "07/20/2022";
numdate = input(chardate,mmddyy10.);
format numdate yymmddn8.;
put numdate=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jul 2022 15:09:36 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-07-21T15:09:36Z</dc:date>
    <item>
      <title>Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824620#M35169</link>
      <description>&lt;P&gt;Hello everyone, I am new to programming in sas and in a table I have an alphanumeric column called "day" that contains values in text format: 07/20/2022 and I want to convert it to 20220720 (yyyymmdd).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How could I change the values of this table?&lt;/P&gt;
&lt;P&gt;Thank you very much in advance, I would also appreciate any type of documentation where I can read about this&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 12:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824620#M35169</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-07-21T12:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824625#M35172</link>
      <description>&lt;P&gt;There are actually three topics you would have to study:&amp;nbsp; the PUT function, the INPUT function, and how SAS handles dates.&amp;nbsp; With that knowledge, it only take one statement (within a DATA step):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;day = put(input(day, mmddyy10.), yymmddn8.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 13:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824625#M35172</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-07-21T13:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824642#M35175</link>
      <description>&lt;PRE&gt;data have;
date="07/20/2022";
run;

data want; 
set have;
format date2 YYMMDDN8.;
date2 = input(date, mmddyy10.);
run;&lt;/PRE&gt;
&lt;P&gt;hello, you can find a lot of similar topics in the forum.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 13:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824642#M35175</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2022-07-21T13:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824657#M35177</link>
      <description>&lt;P&gt;Why would you want a character "date"?&lt;/P&gt;
&lt;P&gt;They don't work well as graph axis.&lt;/P&gt;
&lt;P&gt;You have to go through a similar two-step every time you want to display a date in a different form for any purpose.&lt;/P&gt;
&lt;P&gt;You will have to add variables to the data set to create any sort of report group such as monthly, quarterly or annually that can be accomplished with report or analysis procedure simply by changing the format in procedures like Proc Report, Tabulate, Means, Summary , Univariate and the list goes on.&lt;/P&gt;
&lt;P&gt;Then there is the bit about dealing with anything that wants to use the difference between dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For almost any use leave it as the SAS date value and apply formats as desired.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 14:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824657#M35177</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-07-21T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824686#M35180</link>
      <description>&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 14:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824686#M35180</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-07-21T14:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date values from 07/20/2022 to 20220720 keeping the column in alphanumeric format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824691#M35182</link>
      <description>&lt;P&gt;You do NOT want to store dates in character variables in SAS. Convert the character strings to numeric date values, and apply a suitable format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
chardate = "07/20/2022";
numdate = input(chardate,mmddyy10.);
format numdate yymmddn8.;
put numdate=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 15:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transforming-date-values-from-07-20-2022-to-20220720-keeping-the/m-p/824691#M35182</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-21T15:09:36Z</dc:date>
    </item>
  </channel>
</rss>

