<?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: How to avoid truncation of the data? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472268#M121070</link>
    <description>&lt;P&gt;To have a variable like SEQNO as both character and numeric means that in at least one program where you read the data you created the variable as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might find this bit of code useful for summarizing the characteristics of your variables in the given data sets.&lt;/P&gt;
&lt;P&gt;The 1 in the results columns basically serves to indicate which year of your data has the characteristics of the variables that will be the row headers.&lt;/P&gt;
&lt;PRE&gt;Proc tabulate data=sashelp.vcolumn;
   where libname='RAJ' and 
         memname in ('BRFSS11' 'BRFSS12' 'BRFSS13' 'BRFSS14');
   class memname name type length;
   table name*type* length,
         memname
         /misstext=' '
   ;
run;&lt;/PRE&gt;
&lt;P&gt;And depending on how much your organization does with standardizing BRFSS data variables you a very likely to have question numbers from the survey from different years with different ranges of values not just the occasional change from numeric to character caused by your read program(s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have worked with BRFSS data from collection to reporting in a number of roles since 1998 and have used the data back to 1984. So have developed tools, such as the tabulate above, to summarize the metadata.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 19:40:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-06-21T19:40:10Z</dc:date>
    <item>
      <title>How to avoid truncation of the data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472232#M121047</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I avoid the truncation of the data in the data steps(merge the datasets) of the loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The warnings show:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Multiple lengths were specified for the variable&amp;nbsp;"....." by input data set(s). This can cause truncation of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data raj.brfssfinal;&lt;/P&gt;&lt;P&gt;set raj.brfss11 raj.brfss12 raj.brfss13 raj.brfss14&lt;BR /&gt;raj.brfss15 raj.brfss16;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Out of all those datasets, only brfss16 has a variable seqno which is a character variable and therefore, it gives me an error:&amp;nbsp;ERROR: Variable seqno has been defined as both character and numeric!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I change the character variable in the raj.brfss16 dataset to numerical variable, then it gives me trauncation error for multiple other variable except seqno. I am not sure where am I going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me out with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472232#M121047</guid>
      <dc:creator>raajdesaii</dc:creator>
      <dc:date>2018-06-21T18:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid truncation of the data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472240#M121053</link>
      <description>&lt;P&gt;If you get those datasets from external sources, you need to correct all this in the steps that read the data, and your issues will disappear on their own.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472240#M121053</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T18:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid truncation of the data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472241#M121054</link>
      <description>&lt;P&gt;So by that do you mean convert the variables to either numeric or character in the steps that read the data?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried doing that and it still would not work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472241#M121054</guid>
      <dc:creator>raajdesaii</dc:creator>
      <dc:date>2018-06-21T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid truncation of the data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472244#M121057</link>
      <description>&lt;P&gt;You don't&amp;nbsp;&lt;EM&gt;convert&lt;/EM&gt;, you correct the input and other statements that set variable attributes. Note that you do NOT use proc import in such situations, you use one data step to read all infiles.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472244#M121057</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T18:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid truncation of the data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472268#M121070</link>
      <description>&lt;P&gt;To have a variable like SEQNO as both character and numeric means that in at least one program where you read the data you created the variable as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might find this bit of code useful for summarizing the characteristics of your variables in the given data sets.&lt;/P&gt;
&lt;P&gt;The 1 in the results columns basically serves to indicate which year of your data has the characteristics of the variables that will be the row headers.&lt;/P&gt;
&lt;PRE&gt;Proc tabulate data=sashelp.vcolumn;
   where libname='RAJ' and 
         memname in ('BRFSS11' 'BRFSS12' 'BRFSS13' 'BRFSS14');
   class memname name type length;
   table name*type* length,
         memname
         /misstext=' '
   ;
run;&lt;/PRE&gt;
&lt;P&gt;And depending on how much your organization does with standardizing BRFSS data variables you a very likely to have question numbers from the survey from different years with different ranges of values not just the occasional change from numeric to character caused by your read program(s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have worked with BRFSS data from collection to reporting in a number of roles since 1998 and have used the data back to 1984. So have developed tools, such as the tabulate above, to summarize the metadata.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 19:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-truncation-of-the-data/m-p/472268#M121070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-21T19:40:10Z</dc:date>
    </item>
  </channel>
</rss>

