<?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: Character variable truncated at the 5-digit in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804634#M316882</link>
    <description>&lt;P&gt;Character variables have a specific length (which can be different for each character variable). Your character variable was created to have a length of 5, and so a six character value will be truncated to five characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show the entire data step where this variable IO is created, however, you need to specify the length so that the longest string that will occur in your data can fit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So when you create such a data set, you can start with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydataset;
     length io $ 6;
     set ...;
/* Other data step commands go here */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2022 21:51:42 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-03-28T21:51:42Z</dc:date>
    <item>
      <title>Character variable truncated at the 5-digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804633#M316881</link>
      <description>&lt;P&gt;Dear Madam/Sir,&lt;/P&gt;&lt;P&gt;I created a character variable as below.&lt;/P&gt;&lt;P&gt;if naics in (5412,5413,5417,5418,5414,54161,54162,54169,54191,54193,54199,54192,54194) then IO='&lt;FONT color="#FF0000"&gt;5412OP&lt;/FONT&gt;';&lt;/P&gt;&lt;P&gt;However, variable name is truncated at the 5-digit after SAS operation as below.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;IO Frequency Percent CumulativeFrequency CumulativePercent&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV align="center"&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;5412O &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;126&lt;/TD&gt;&lt;TD&gt;0.24&lt;/TD&gt;&lt;TD&gt;46240&lt;/TD&gt;&lt;TD&gt;89.60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;It will be highly appreciated if you can advise me how to avoid this variable truncation problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joon1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 21:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804633#M316881</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2022-03-28T21:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable truncated at the 5-digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804634#M316882</link>
      <description>&lt;P&gt;Character variables have a specific length (which can be different for each character variable). Your character variable was created to have a length of 5, and so a six character value will be truncated to five characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show the entire data step where this variable IO is created, however, you need to specify the length so that the longest string that will occur in your data can fit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So when you create such a data set, you can start with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydataset;
     length io $ 6;
     set ...;
/* Other data step commands go here */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 21:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804634#M316882</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-28T21:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable truncated at the 5-digit</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804637#M316883</link>
      <description>&lt;P&gt;Thank you for your kind help, PaigeMiller. It is straightforward, but I couldn't find a relevant posting. Have a great week.&lt;/P&gt;&lt;P&gt;Joon1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 22:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-truncated-at-the-5-digit/m-p/804637#M316883</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2022-03-28T22:06:27Z</dc:date>
    </item>
  </channel>
</rss>

