<?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: Saving data to a permanent SAS data set - variables required to be certain lengths in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668180#M200241</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294090"&gt;@Bluekeys49&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi.&amp;nbsp; I am saving some data to a permanent SAS dataset.&amp;nbsp; I can easily do that, but notice when I do a "proc contents," my variable fields lengths are not what I want them to be in the saved dataset.&amp;nbsp; For example, I have a variables called GROUP1, GROUP2, and GROUP3 which have values of&amp;nbsp; 1, 2, or 3.&amp;nbsp; Each variable is showing a character type with a length of 3 in proc contents.&amp;nbsp; I would like it to have length of 1 for each.&amp;nbsp; How and where do I indicate this in my program?&amp;nbsp; I tried the code below and it didn't work.&amp;nbsp; Perhaps my GROUP1 - GROUP3 is incorrect syntax?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;* output to SAS perm dataset;&lt;BR /&gt;data dat1.tempdata;&lt;BR /&gt;&amp;nbsp; length GROUP1 - GROUP3 ($1.);&lt;BR /&gt;&amp;nbsp; set TWO ;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Such things should be fixed or set as early as practical. If you create these variables then the length should be set then, if you are reading them from an external data source that might be the place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If these are coming from using Proc Import then perhaps another way to read the data should be investigated as there is NO way to know the properties of any variable as the procedure makes guesses separately for each file read.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jul 2020 20:25:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-09T20:25:42Z</dc:date>
    <item>
      <title>Saving data to a permanent SAS data set - variables required to be certain lengths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668153#M200232</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; I am saving some data to a permanent SAS dataset.&amp;nbsp; I can easily do that, but notice when I do a "proc contents," my variable fields lengths are not what I want them to be in the saved dataset.&amp;nbsp; For example, I have a variables called GROUP1, GROUP2, and GROUP3 which have values of&amp;nbsp; 1, 2, or 3.&amp;nbsp; Each variable is showing a character type with a length of 3 in proc contents.&amp;nbsp; I would like it to have length of 1 for each.&amp;nbsp; How and where do I indicate this in my program?&amp;nbsp; I tried the code below and it didn't work.&amp;nbsp; Perhaps my GROUP1 - GROUP3 is incorrect syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;* output to SAS perm dataset;&lt;BR /&gt;data dat1.tempdata;&lt;BR /&gt;&amp;nbsp; length GROUP1 - GROUP3 ($1.);&lt;BR /&gt;&amp;nbsp; set TWO ;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 19:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668153#M200232</guid>
      <dc:creator>Bluekeys49</dc:creator>
      <dc:date>2020-07-09T19:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Saving data to a permanent SAS data set - variables required to be certain lengths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668157#M200236</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length group1-group3 $1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jul 2020 19:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668157#M200236</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-09T19:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Saving data to a permanent SAS data set - variables required to be certain lengths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668180#M200241</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294090"&gt;@Bluekeys49&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi.&amp;nbsp; I am saving some data to a permanent SAS dataset.&amp;nbsp; I can easily do that, but notice when I do a "proc contents," my variable fields lengths are not what I want them to be in the saved dataset.&amp;nbsp; For example, I have a variables called GROUP1, GROUP2, and GROUP3 which have values of&amp;nbsp; 1, 2, or 3.&amp;nbsp; Each variable is showing a character type with a length of 3 in proc contents.&amp;nbsp; I would like it to have length of 1 for each.&amp;nbsp; How and where do I indicate this in my program?&amp;nbsp; I tried the code below and it didn't work.&amp;nbsp; Perhaps my GROUP1 - GROUP3 is incorrect syntax?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;* output to SAS perm dataset;&lt;BR /&gt;data dat1.tempdata;&lt;BR /&gt;&amp;nbsp; length GROUP1 - GROUP3 ($1.);&lt;BR /&gt;&amp;nbsp; set TWO ;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Such things should be fixed or set as early as practical. If you create these variables then the length should be set then, if you are reading them from an external data source that might be the place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If these are coming from using Proc Import then perhaps another way to read the data should be investigated as there is NO way to know the properties of any variable as the procedure makes guesses separately for each file read.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 20:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-data-to-a-permanent-SAS-data-set-variables-required-to-be/m-p/668180#M200241</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-09T20:25:42Z</dc:date>
    </item>
  </channel>
</rss>

