<?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 field length need to change from 8 byte to 4 byte. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161636#M31400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why did you want convert it from 8 to 4 ? Why not just use 8 as simple as it was ? Since you are appending a table at bottom of another table , sql is going to convert them all into 8 . Wouldn't it be better ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from one&lt;/P&gt;&lt;P&gt;union all corr&lt;/P&gt;&lt;P&gt;select * from two ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have to convert 8 into 4 ,then you have to make another variable which has length of 4 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length new 4 ;&lt;/P&gt;&lt;P&gt;new=old;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that might be losing exact float .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Sep 2014 13:31:56 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-09-26T13:31:56Z</dc:date>
    <item>
      <title>date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161634#M31398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have base dataset with date field 4 byte. I want to append records to it which has the date field 8 byte.&lt;/P&gt;&lt;P&gt;can anyone help me how to convert 8 byte number to 4 byte which will hold the same date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Durga.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 11:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161634#M31398</guid>
      <dc:creator>durga</dc:creator>
      <dc:date>2014-09-26T11:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161635#M31399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please clarify what you mean with some test data.&amp;nbsp; As far as I am aware date variables are always length=8 as they are numeric counts of days since a certain date.&amp;nbsp; Bytes should not come into it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 12:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161635#M31399</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-26T12:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161636#M31400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why did you want convert it from 8 to 4 ? Why not just use 8 as simple as it was ? Since you are appending a table at bottom of another table , sql is going to convert them all into 8 . Wouldn't it be better ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from one&lt;/P&gt;&lt;P&gt;union all corr&lt;/P&gt;&lt;P&gt;select * from two ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have to convert 8 into 4 ,then you have to make another variable which has length of 4 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length new 4 ;&lt;/P&gt;&lt;P&gt;new=old;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that might be losing exact float .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 13:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161636#M31400</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-26T13:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161637#M31401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably do not need to do anything.&amp;nbsp; SAS will just throw away the extra bits of precision. And dates, since they are just the number of days, do not need that extra precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume you have two tables OLD and NEW and you want to add the records from NEW onto those in OLD.&lt;/P&gt;&lt;P&gt;If you use a datastep&amp;nbsp; to make a new dataset then the lengths will be set by what length is defined first.&lt;/P&gt;&lt;P&gt;data&amp;nbsp; master ; set old new ; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use PROC APPEND then the data will be appended into the OLD table and so of course will have the same length.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 13:47:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161637#M31401</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-26T13:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161638#M31402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only reason for that issue is proc append usage. &lt;A href="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n19kwc3onglzh2n1l2k4e39edv3x.htm" title="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#n19kwc3onglzh2n1l2k4e39edv3x.htm"&gt;Base SAS(R) 9.4 Procedures Guide, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Using proc append is avoiding all the IO overhead of other approaches by just modifying growing the base dataset on dasd in place.&lt;/P&gt;&lt;P&gt;The force option solve some of the differneces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way of creating the new to append observations is generating a 0-observations data-set for the base and appending that.&lt;/P&gt;&lt;P&gt;Correcting a modify-update dataset is also possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data cor_updates ;&lt;/P&gt;&lt;P&gt;set base_obs&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;set old_updates ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;data cor_updates ;&lt;/P&gt;&lt;P&gt;attrib var1&amp;nbsp;&amp;nbsp; ...... ;&amp;nbsp; /*(correction var-defs) */&lt;/P&gt;&lt;P&gt;set old_updates;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 16:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161638#M31402</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-26T16:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: date field length need to change from 8 byte to 4 byte.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161639#M31403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let's say you have data sets a (length of date_old=8) and b (length of date_old=4),&lt;/P&gt;&lt;P&gt;data new (drop=date_old&amp;nbsp;&amp;nbsp;&amp;nbsp; rename=(date_new=date_old));&lt;/P&gt;&lt;P&gt;length date_new 4.;&lt;/P&gt;&lt;P&gt;set a;&lt;/P&gt;&lt;P&gt;date_new=date_old;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;set new b;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep posted to let us know, if it worked..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2014 05:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-field-length-need-to-change-from-8-byte-to-4-byte/m-p/161639#M31403</guid>
      <dc:creator>nravi</dc:creator>
      <dc:date>2014-09-27T05:30:10Z</dc:date>
    </item>
  </channel>
</rss>

