<?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: DATE CONVERSION in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913999#M360183</link>
    <description>I would like to know which informat and format need to use to convert that 202208 to AUG22</description>
    <pubDate>Thu, 01 Feb 2024 12:44:09 GMT</pubDate>
    <dc:creator>kalyan11</dc:creator>
    <dc:date>2024-02-01T12:44:09Z</dc:date>
    <item>
      <title>DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913993#M360179</link>
      <description>&lt;P&gt;I have data like 202208 and I need to convert it to AUG22. Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 12:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913993#M360179</guid>
      <dc:creator>kalyan11</dc:creator>
      <dc:date>2024-02-01T12:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913994#M360180</link>
      <description>&lt;P&gt;Numeric or character? If numeric, which format is assigned to the variable?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 12:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913994#M360180</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-01T12:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913995#M360181</link>
      <description>I need to convert 202208 to AUG22 on mainframe. I have an input with the data 202208, 202209 etc. I need to convert them to AUG22, SEP22 on mainframe.</description>
      <pubDate>Thu, 01 Feb 2024 12:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913995#M360181</guid>
      <dc:creator>kalyan11</dc:creator>
      <dc:date>2024-02-01T12:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913996#M360182</link>
      <description>&lt;P&gt;Define "input". Is this manually typed in by somebody, or stored in a file, or supplied to the SAS program as a JCL parameter?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 12:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913996#M360182</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-01T12:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913999#M360183</link>
      <description>I would like to know which informat and format need to use to convert that 202208 to AUG22</description>
      <pubDate>Thu, 01 Feb 2024 12:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/913999#M360183</guid>
      <dc:creator>kalyan11</dc:creator>
      <dc:date>2024-02-01T12:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914002#M360184</link>
      <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0verk17pchh4vn1akrrv0b5w3r0.htm#p1e04n02q6dodwn1g3cemqesa57q" target="_blank" rel="noopener"&gt;Date Informats&lt;/A&gt;&amp;nbsp;, see YYMMN&lt;/P&gt;
&lt;P&gt;From this page, you can also find the documentation of display formats.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 12:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914002#M360184</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-01T12:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914011#M360185</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463060"&gt;@kalyan11&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I would like to know which informat and format need to use to convert that 202208 to AUG22&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To really answer your question you need to tell us if your source value is a number, a string or already a SAS date value just with a format attached that displays the value as yyyymm.&lt;/P&gt;
&lt;P&gt;You then also need to tell us if the result you want should be a SAS date value with a format attached that displays as monyy or if you need a string stored in a character variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look into below sample code. If there is anything in it you don't understand then consult the SAS docu - format and informats and even more so how SAS date values work if you don't know that already.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
  var1_char ='202208';
  var2_num  =202208;

  var1_SAS_dt_val=input(var1_char,yymmn6.);
  var2_SAS_dt_val=input(put(var2_num,f6.),yymmn6.);
  format var1_SAS_dt_val var2_SAS_dt_val monyy6.;

  var1_string=put(var1_SAS_dt_val,monyy6.);
  var2_string=put(var2_SAS_dt_val,monyy6.);

run;

proc print data=demo;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1706794506063.png" style="width: 580px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93148i2DC1145F27AA2BCC/image-dimensions/580x58?v=v2" width="580" height="58" role="button" title="Patrick_0-1706794506063.png" alt="Patrick_0-1706794506063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914011#M360185</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-01T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: DATE CONVERSION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914015#M360186</link>
      <description>&lt;P&gt;Adding to the fine advice from others: it doesn't matter where the values come from, database or Excel or otherwise. It matters what the values are in your SAS data set. And to make the proper decision about how to program this, as demonstrated above, you MUST know if in SAS these variables are numeric or text (also called "character"), and in many cases, you also MUST know what the format of the SAS variable in the SAS data set is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463060"&gt;@kalyan11&lt;/a&gt;&amp;nbsp;have been asked several times to tell us this, you haven't given us this information, and you absolutely will need this to program the conversion properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find this information by running PROC CONTENTS on your SAS data set. Here is an example of running PROC CONTENTS on a different data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=sashelp.cars;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1706795071831.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93151i7577EC6C8BA97B2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PaigeMiller_0-1706795071831.png" alt="PaigeMiller_0-1706795071831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, there is a variable named Cylinders which is numeric, and variable named DriveTrain which is Character. Variable named INVOICE has a format assigned to it.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 13:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-CONVERSION/m-p/914015#M360186</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-01T13:45:53Z</dc:date>
    </item>
  </channel>
</rss>

