<?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 SAS cutting off last column when creating data with input using (type = corr) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876937#M346427</link>
    <description>&lt;P&gt;&amp;nbsp;I am trying to create a basic correlation matrix using type = corr. I've looked at multiple sources, and tried adding line numbers (e.g., q28 5-9), length, and formatting statements, but it continues to truncate the last variable. It's worth noting that no matter how many variables I add, it always truncates the last. Q29 prints fine in the datastep below, but if I removed Q30, it would become truncated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;title "Confirmatory Factor Analysis Using the FACTOR Modeling Language";
title2 "Cognitive Data";
data datacorr (type=corr);
infile cards missover;
_Type_ = "corr";
input _Name_ $ q28 q29 q30;
datalines;    
q28  1.00          
q29 -0.30  1.00  
q30 -0.24  0.43  1.00         
;&lt;/PRE&gt;&lt;P&gt;This is what I see:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_Type_    _Name_     q28      q29    q30

corr      q28       1.00     .       . 
corr      q29      -0.30    1.00     . 
corr      q30      -0.24    0.43     1 &lt;/PRE&gt;&lt;P&gt;It should be 1.00. This is a simple example for illustration; I previously included mean, std, and N, and ran into the same issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 18:42:56 GMT</pubDate>
    <dc:creator>Caetreviop543</dc:creator>
    <dc:date>2023-05-22T18:42:56Z</dc:date>
    <item>
      <title>SAS cutting off last column when creating data with input using (type = corr)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876937#M346427</link>
      <description>&lt;P&gt;&amp;nbsp;I am trying to create a basic correlation matrix using type = corr. I've looked at multiple sources, and tried adding line numbers (e.g., q28 5-9), length, and formatting statements, but it continues to truncate the last variable. It's worth noting that no matter how many variables I add, it always truncates the last. Q29 prints fine in the datastep below, but if I removed Q30, it would become truncated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;title "Confirmatory Factor Analysis Using the FACTOR Modeling Language";
title2 "Cognitive Data";
data datacorr (type=corr);
infile cards missover;
_Type_ = "corr";
input _Name_ $ q28 q29 q30;
datalines;    
q28  1.00          
q29 -0.30  1.00  
q30 -0.24  0.43  1.00         
;&lt;/PRE&gt;&lt;P&gt;This is what I see:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_Type_    _Name_     q28      q29    q30

corr      q28       1.00     .       . 
corr      q29      -0.30    1.00     . 
corr      q30      -0.24    0.43     1 &lt;/PRE&gt;&lt;P&gt;It should be 1.00. This is a simple example for illustration; I previously included mean, std, and N, and ran into the same issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 18:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876937#M346427</guid>
      <dc:creator>Caetreviop543</dc:creator>
      <dc:date>2023-05-22T18:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS cutting off last column when creating data with input using (type = corr)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876948#M346428</link>
      <description>&lt;P&gt;It is fine as is. If you want the value to be printed as "1.00" then assign a 5.2 format to that column.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 19:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876948#M346428</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2023-05-22T19:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS cutting off last column when creating data with input using (type = corr)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876949#M346429</link>
      <description>&lt;P&gt;Nothing has been cut off.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You read the last column as a number.&amp;nbsp; The two number 1 and 1.00 are the exact same number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the values to always display with two decimal places you will have to attach a FORMAT to the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you attach the format specification 8.2 to the variables&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format q28 q29 q30 8.2 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then they will print with 8 characters. 2 of them to right of the decimal point. And one for the decimal point.&amp;nbsp; The last 5 will be used for the whole number part of the value and any hyphen needed to represent a negative value.&amp;nbsp; So 8.2 can display values from -9999.99 to 99999.99 .&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 19:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-cutting-off-last-column-when-creating-data-with-input-using/m-p/876949#M346429</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-22T19:05:55Z</dc:date>
    </item>
  </channel>
</rss>

