<?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 Proc Tranpose Truncating var values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476608#M122663</link>
    <description>&lt;P&gt;I am attempting to use proc tranpose but in the output data set the values in the _NAME_ variable keep getting truncated. Below is the transpose code I am using. Any suggestions to prevent SAS from truncating the data? I tried using array but can't figure out how to replicated the _NAME_ variable proc tranpose provides. The only thing I haven't tried yet is using a macro loop in a similar fashion as an array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;test data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Abun_dw20d_summary ;    &lt;BR /&gt;   informat bins $30.; format bins $30.; length bins $30.;
   input bins $ CM1DW20D CM3DW20D CW1DW20D ODWD W1DW4D;
   datalines;         
Acinetobacter 2477 195  163 45 77
Actinoalloteichus 2431 220  198 69 6774
Bacillus 2456 173  155 78 785
Bletilla 2412 135  116 45 123
;   
run;


proc transpose data=Abun_dw20d_summary out=bint;
    var _all_;
    by bins;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Jul 2018 21:20:13 GMT</pubDate>
    <dc:creator>michelconn</dc:creator>
    <dc:date>2018-07-09T21:20:13Z</dc:date>
    <item>
      <title>Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476608#M122663</link>
      <description>&lt;P&gt;I am attempting to use proc tranpose but in the output data set the values in the _NAME_ variable keep getting truncated. Below is the transpose code I am using. Any suggestions to prevent SAS from truncating the data? I tried using array but can't figure out how to replicated the _NAME_ variable proc tranpose provides. The only thing I haven't tried yet is using a macro loop in a similar fashion as an array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;test data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Abun_dw20d_summary ;    &lt;BR /&gt;   informat bins $30.; format bins $30.; length bins $30.;
   input bins $ CM1DW20D CM3DW20D CW1DW20D ODWD W1DW4D;
   datalines;         
Acinetobacter 2477 195  163 45 77
Actinoalloteichus 2431 220  198 69 6774
Bacillus 2456 173  155 78 785
Bletilla 2412 135  116 45 123
;   
run;


proc transpose data=Abun_dw20d_summary out=bint;
    var _all_;
    by bins;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jul 2018 21:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476608#M122663</guid>
      <dc:creator>michelconn</dc:creator>
      <dc:date>2018-07-09T21:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476613#M122664</link>
      <description>&lt;P&gt;At least in your example data the BINS variable truncated to 8 characters because it isn't read with more than 8 characters.&lt;/P&gt;
&lt;P&gt;So _name_ would only be 8.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 21:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476613#M122664</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-09T21:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476614#M122665</link>
      <description>&lt;P&gt;Truncation is happening while reading data itself and you need to fix while reading the data by using informat or length statement as shown below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Abun_dw20d_summary ;  
informat bins $30.;
   input bins $ CM1DW20D CM3DW20D CW1DW20D ODWD W1DW4D;
   datalines;         
Acinetobacter 2477 195  163 45 77
Actinoalloteichus 2431 220  198 69 6774
Bacillus 2456 173  155 78 785
Bletilla 2412 135  116 45 123
;   
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jul 2018 21:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476614#M122665</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-07-09T21:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476616#M122667</link>
      <description>This doesn't appear to fix the issue. I'm not worried about the bins variable that was just an example. After I transpose the dataset the values in the _NAME_ variable are being truncated. For example the value "CM1DW20D" apepears as "CM1DW20" in the _NAME_ variable on the transposed dataset.</description>
      <pubDate>Mon, 09 Jul 2018 21:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476616#M122667</guid>
      <dc:creator>michelconn</dc:creator>
      <dc:date>2018-07-09T21:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476617#M122668</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38419"&gt;@michelconn&lt;/a&gt;&amp;nbsp; That's not truncating although it looks like it does. Just take the mouse and expand the view table window or run a proc print&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Abun_dw20d_summary ;                    
   input bins $ CM1DW20D CM3DW20D CW1DW20D ODWD W1DW4D;
   datalines;         
Acinetobacter 2477 195  163 45 77
Actinoalloteichus 2431 220  198 69 6774
Bacillus 2456 173  155 78 785
Bletilla 2412 135  116 45 123
;   
run;


proc transpose data=Abun_dw20d_summary out=bint;
    var _all_;
    by bins;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;The SAS System&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs bins _NAME_ COL1123456789101112131415161718192021222324 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;bins&lt;/TD&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;CM1DW20D&lt;/TD&gt;&lt;TD&gt;2477&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;CM3DW20D&lt;/TD&gt;&lt;TD&gt;195&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;CW1DW20D&lt;/TD&gt;&lt;TD&gt;163&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;ODWD&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acinetob&lt;/TD&gt;&lt;TD&gt;W1DW4D&lt;/TD&gt;&lt;TD&gt;77&lt;/TD&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gt;ODWD&lt;/TD&gt;&lt;TD&gt;78&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacillus&lt;/TD&gt;&lt;TD&gt;W1DW4D&lt;/TD&gt;&lt;TD&gt;785&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;bins&lt;/TD&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;CM1DW20D&lt;/TD&gt;&lt;TD&gt;2412&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;CM3DW20D&lt;/TD&gt;&lt;TD&gt;135&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;CW1DW20D&lt;/TD&gt;&lt;TD&gt;116&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;ODWD&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bletilla&lt;/TD&gt;&lt;TD&gt;W1DW4D&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Jul 2018 21:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476617#M122668</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-09T21:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476618#M122669</link>
      <description>I added additional code to prevent the bins variable from being truncated. Although this doesn't solve the issue of the values in the _NAME_ variable of the transposed data being truncated. For example the value "CM1DW20D" is being read as "CM1DW20D".</description>
      <pubDate>Mon, 09 Jul 2018 21:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476618#M122669</guid>
      <dc:creator>michelconn</dc:creator>
      <dc:date>2018-07-09T21:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476619#M122670</link>
      <description>Well I'm a dummy, thanks.</description>
      <pubDate>Mon, 09 Jul 2018 21:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476619#M122670</guid>
      <dc:creator>michelconn</dc:creator>
      <dc:date>2018-07-09T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tranpose Truncating var values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476620#M122671</link>
      <description>&lt;P&gt;lol That makes two of us. I am surpised the cop&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; who corrects me and makes me learn didn't point that . lol&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 21:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tranpose-Truncating-var-values/m-p/476620#M122671</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-09T21:23:52Z</dc:date>
    </item>
  </channel>
</rss>

