<?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: create (in a new variable) a truncated version of an existing variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80796#M23289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thank you thank you thank you thank you !&amp;nbsp; A million thank yous.&amp;nbsp; Such brilliant minds here.&amp;nbsp; I tried it and it does work.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a new twist (shown below).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;In looking at the dataset, I see the variable REPDATE is a character variable.&amp;nbsp; This is because I imported the dataset from an external source as shown below, and SAS automatically decided to treat the REPDATE variable as a character variable when it did the import.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;PROC IMPORT OUT= WORK.in_apids &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE='Pids02q4.dbf'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=DBF REPLACE;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETDELETED=NO;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;RUN;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New twist:&amp;nbsp; I would like the two newly-created variables to be numeric despite the fact that the REPDATE variable got imported as a character variable.&amp;nbsp; Is there any way I could change the PROC IMPORT code shown above, to force SAS to import the REPDATE variable as numeric instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am not mistaken, I think this can be done with the PUT statement like Jonam said, yes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;year=substr(put(repdate,6.),1,4);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My question is: Will the PUT statement shown above work to create a numeric 4-digit variable for year, even though the REPDATE variable is character?&amp;nbsp; If so, then that would be awesome!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Sep 2012 12:46:07 GMT</pubDate>
    <dc:creator>Bautista</dc:creator>
    <dc:date>2012-09-30T12:46:07Z</dc:date>
    <item>
      <title>create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80792#M23285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Recently I inherited a large dataset (apids.sas7bdat).&amp;nbsp; It contains a variable called "REPDATE" which is essentially a concatenated YYYY and MM.&amp;nbsp; For example, if the date when a case was reported was in July 2008 the creators of the dataset combined the year 2008 and the month 07 so the "REPDATE" value is 200807.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, the following are the values in the dataset for January 2002, February 1981 and October 1985 respectively:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;REPDATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;200201&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;198102&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;198510&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to "split" the REPDATE variable into two new variables called REPYEAR and REPMONTH.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously the values for REPYEAR will just be the first 4 numbers in REPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the values for REPMONTH will just be the last 2 numbers in REPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would still like to keep the REPDATE variable in the dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a suggestion for how I could achieve these two new variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 00:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80792#M23285</guid>
      <dc:creator>Bautista</dc:creator>
      <dc:date>2012-09-30T00:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80793#M23286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Questions about repdate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it a numeric where 200201 is really captured as 200,201 or&lt;/P&gt;&lt;P&gt;Is it a numeric where 200201 ia really captured as the SAS date for 1/1/2002 or&lt;/P&gt;&lt;P&gt;Is it a character variable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 00:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80793#M23286</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-09-30T00:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80794#M23287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending whether repdate is character or numeric...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data have;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;length repdatec $6;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;input repdate @1 repdatec;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;200201&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;198102&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;198510 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data want;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;length yearc $4 monthc $2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;/* If numeric */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;year = floor(repdate/100);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;month = mod(repdate,100);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;/* If character */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;yearc = substr(repdatec,1,4);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;monthc = substr(repdatec,5,2);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 01:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80794#M23287</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-09-30T01:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80795#M23288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bautista,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PGstats answered your question already. since you've not mentioned it's char or numeric. you can also use put(),substr() to do it as follows.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;length repdatec $6;&lt;/P&gt;&lt;P&gt;input repdate @1 repdatec;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;200201&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;198102&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;198510 &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;year=substr(put(repdate,6.),1,4);&lt;/P&gt;&lt;P&gt;year1=substr(put(repdatec,6.),1,4);&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 05:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80795#M23288</guid>
      <dc:creator>jonam</dc:creator>
      <dc:date>2012-09-30T05:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80796#M23289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thank you thank you thank you thank you !&amp;nbsp; A million thank yous.&amp;nbsp; Such brilliant minds here.&amp;nbsp; I tried it and it does work.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a new twist (shown below).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;In looking at the dataset, I see the variable REPDATE is a character variable.&amp;nbsp; This is because I imported the dataset from an external source as shown below, and SAS automatically decided to treat the REPDATE variable as a character variable when it did the import.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;PROC IMPORT OUT= WORK.in_apids &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE='Pids02q4.dbf'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=DBF REPLACE;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETDELETED=NO;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;RUN;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New twist:&amp;nbsp; I would like the two newly-created variables to be numeric despite the fact that the REPDATE variable got imported as a character variable.&amp;nbsp; Is there any way I could change the PROC IMPORT code shown above, to force SAS to import the REPDATE variable as numeric instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am not mistaken, I think this can be done with the PUT statement like Jonam said, yes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;year=substr(put(repdate,6.),1,4);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My question is: Will the PUT statement shown above work to create a numeric 4-digit variable for year, even though the REPDATE variable is character?&amp;nbsp; If so, then that would be awesome!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 12:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80796#M23289</guid>
      <dc:creator>Bautista</dc:creator>
      <dc:date>2012-09-30T12:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80797#M23290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, you can multiply by 1 which implicitly converts to numeric.&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit;"&gt;year=substr(put(repdate,6.),1,4) *1;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 13:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80797#M23290</guid>
      <dc:creator>jonam</dc:creator>
      <dc:date>2012-09-30T13:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: create (in a new variable) a truncated version of an existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80798#M23291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to create numeric year and month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt;year=input(substr(repdate,1,4),4.);&lt;/P&gt;&lt;P&gt;month=input(substr(repdate,5,2),2.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 16:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/create-in-a-new-variable-a-truncated-version-of-an-existing/m-p/80798#M23291</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-09-30T16:37:48Z</dc:date>
    </item>
  </channel>
</rss>

