<?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: negative values not displaying during PROC PRINT in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619911#M8693</link>
    <description>&lt;P&gt;Thank you so much. This is the explanation I was lacking. I appreciate your time and clarity.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2020 19:22:13 GMT</pubDate>
    <dc:creator>eileencant</dc:creator>
    <dc:date>2020-01-24T19:22:13Z</dc:date>
    <item>
      <title>negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619680#M8687</link>
      <description>&lt;P&gt;I am using SAS Studio. On my very first SAS homework, I have to manually enter the data. The first column is a non-numeric indicator ($); the second column contains both positive and negative values. After manually entering the code below, I ran the code to inspect the data and the negative values are showing up as *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;DATA a;&lt;BR /&gt;INPUT var1 $ 1 var2 3;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1 0&lt;BR /&gt;1 -3&lt;BR /&gt;1 -2&lt;BR /&gt;1 -1&lt;BR /&gt;2 1&lt;BR /&gt;2 2&lt;BR /&gt;2 1&lt;BR /&gt;2 0&lt;BR /&gt;3 10&lt;BR /&gt;3 12&lt;BR /&gt;3 8&lt;BR /&gt;3 5&lt;BR /&gt;4 3&lt;BR /&gt;4 2&lt;BR /&gt;4 3&lt;BR /&gt;4 4&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Screen shot of data view attached. Many thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619680#M8687</guid>
      <dc:creator>eileencant</dc:creator>
      <dc:date>2020-01-23T21:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619691#M8688</link>
      <description>&lt;P&gt;Look at your log before you look at your data display.&amp;nbsp; When I run your code, the log shows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1378  DATA a;
1379  INPUT var1 $ 1 var2 3;
1380  DATALINES;

NOTE: Invalid data for var2 in line 1382 3-3.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1382        1 -3
var1=1 var2=. _ERROR_=1 _N_=2
NOTE: Invalid data for var2 in line 1383 3-3.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1383        1 -2
var1=1 var2=. _ERROR_=1 _N_=3
NOTE: Invalid data for var2 in line 1384 3-3.
1384        1 -1
var1=1 var2=. _ERROR_=1 _N_=4
NOTE: The data set WORK.A has 16 observations and 2 variables.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interpret the NOTE on the log, which says invalid data for VAR2 in line xxx 3-3&amp;nbsp; (columns 3 through 3).&amp;nbsp; Look at column 3 in the RULE line and DATA line that follow.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619691#M8688</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-01-23T21:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619693#M8689</link>
      <description>&lt;P&gt;Your INPUT statement is incorrect - check your SAS log for the messages regarding invalid data. Try this:&lt;/P&gt;
&lt;PRE&gt;INPUT var1 $ var2;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619693#M8689</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-23T21:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619695#M8690</link>
      <description>&lt;P&gt;Read you LOG.&lt;/P&gt;
&lt;P&gt;You would have seen something like:&lt;/P&gt;
&lt;PRE&gt;NOTE: Invalid data for var2 in line 1040 3-3.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+-
1040        1 -3
var1=1 var2=. _ERROR_=1 _N_=2
NOTE: Invalid data for var2 in line 1041 3-3.
1041        1 -2
var1=1 var2=. _ERROR_=1 _N_=3
NOTE: Invalid data for var2 in line 1042 3-3.
1042        1 -1
var1=1 var2=. _ERROR_=1 _N_=4
NOTE: The data set USER.A has 16 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds

&lt;/PRE&gt;
&lt;P&gt;What was your purpose for having the 3 at the end of the input statement? It is really a good idea to attempt to limit the length of numeric variables as the storage for numeric values is different than for character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;DATA a;
INPUT var1 $1.  var2 ;
DATALINES;
1 0
1 -3
1 -2
1 -1
2 1
2 2
2 1
2 0
3 10
3 12
3 8
3 5
4 3
4 2
4 3
4 4
;
RUN;
&lt;/PRE&gt;
&lt;P&gt;and see if that behaves better.&lt;/P&gt;
&lt;P&gt;You attempted to put a value into less space than needed to store it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="tgroup"&gt;&lt;CAPTION class="xis-title"&gt;Significant Digits and Largest Integer by Length for SAS Variables under Windows&lt;/CAPTION&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="n174bmc1laxjzjn10y2yf5viha0h"&gt;Length in Bytes&lt;/DIV&gt;
&lt;/TH&gt;
&lt;TH class="xis-horizontalRight xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="p15k1g85plj9o9n11fjnqyyn1x36"&gt;Largest Integer Represented Exactly&lt;/DIV&gt;
&lt;/TH&gt;
&lt;TH class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1owae7fvk3mzjn11rof2y5aadpm"&gt;Exponential Notation&lt;/DIV&gt;
&lt;/TH&gt;
&lt;TH class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="p0qg6ej6xvkfryn1skdvb9wy80kw"&gt;Significant Digits Retained&lt;/DIV&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0vdovlnw1jk4in173vq2bjsw0js"&gt;3&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="p1f3qgbma4ecofn1r77e538oqfij"&gt;8,192&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="p059il46kyrpm8n1bom3hr5ug8yj"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;13&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalBottom"&gt;
&lt;DIV class="xis-paraTableFirst" id="n05mpz1ey131ben13hkg3rrphakm"&gt;3&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0m84znlqemra6n196i2gf1m0hxj"&gt;4&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="p0ckjlpq2wmhy2n1otb42mnj7ppm"&gt;2,097,152&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0ffmy9pe0kz3in1nfdypk6qdo9l"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;21&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n01mhhp1x1vskun1smk16tg47exa"&gt;6&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="p14y7xm0g118hjn1jvfebvmv65ey"&gt;5&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="p0qc2t67xrxzurn1oadxxpz3f23v"&gt;536,870,912&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1wwgylhnt3fwon12q2te5ay0b3r"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;29&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0gv8pcgcz9ve5n1w3cgupo92ug8"&gt;8&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0yq90v8i0xm2en1g9fjtn0fd213"&gt;6&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1xdxykf4b39cmn148yozh85c6tf"&gt;137,438,953,472&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n0k1rpdh3hrt9zn15gtob220b772"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;37&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1c1nx3u7xrvnyn1db8r450n6ss7"&gt;11&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n08tlixxzwkw99n1kszepzwfwc4y"&gt;7&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1myxoaszxwpw1n1fn7asn52iols"&gt;35,184,372,088,832&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n135d8ryr7mns7n189ooh3p8yuf0"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;45&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n04lgwu79588van15kjvvyi33199"&gt;13&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n03khpkdiu3jeyn101034amjy2c2"&gt;8&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalRight xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="p17thjcv8btyc4n1l86zaaznq4j4"&gt;9,007,199,254,740,992&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1ddqo0zh75y0fn1tlrwh6sr2mr5"&gt;2&lt;SUP&gt;&lt;FONT size="2"&gt;53&lt;/FONT&gt;&lt;/SUP&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV class="xis-paraTableFirst" id="n1t4vquuqxntk7n1mumgbm5n651h"&gt;15&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV class="xis-paragraph" id="p0sig88cz4j2qwn1i643zxft1xuf"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;Some variation in operating systems but the negative values require more storage than the simple integers.&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619695#M8690</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-23T21:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619698#M8691</link>
      <description>&lt;P&gt;Thanks, everyone. I don't know enough SAS to interpret your messages, but I very much appreciate your time and I eventually got it to work by adding more columns. Here is what worked and I truly appreciate your help as a SAS novice. (I don't even know if the "version" I am using is "SAS Studio" or "SAS UE" but I should have mentioned this. New code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA a;&lt;BR /&gt;INPUT var1 $ 1 var2 3-5;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1 +00&lt;BR /&gt;1 -03&lt;BR /&gt;1 -02&lt;BR /&gt;1 -01&lt;BR /&gt;2 +01&lt;BR /&gt;2 +02&lt;BR /&gt;2 +01&lt;BR /&gt;2 +00&lt;BR /&gt;3 +10&lt;BR /&gt;3 +12&lt;BR /&gt;3 +08&lt;BR /&gt;3 +05&lt;BR /&gt;4 +03&lt;BR /&gt;4 +02&lt;BR /&gt;4 +03&lt;BR /&gt;4 +04&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 22:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619698#M8691</guid>
      <dc:creator>eileencant</dc:creator>
      <dc:date>2020-01-23T22:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619716#M8692</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/308677"&gt;@eileencant&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, everyone. I don't know enough SAS to interpret your messages, but I very much appreciate your time and I eventually got it to work by adding more columns. Here is what worked and I truly appreciate your help as a SAS novice. (I don't even know if the "version" I am using is "SAS Studio" or "SAS UE" but I should have mentioned this. New code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA a;&lt;BR /&gt;INPUT var1 $ 1 var2 3-5;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When you put digits after a variable on an input statement then you telling a explicit column to read from. So when you said&lt;/P&gt;
&lt;P&gt;input var1 $ 1 var2 3;&lt;/P&gt;
&lt;P&gt;you said Var2 exists only in column 3. Without the $ the variable is numeric. So when the - sign was encountered that was all SAS was allowed to read and a negative sign needs at least one other digit.&lt;/P&gt;
&lt;P&gt;This style of reading values is called "Fixed Column" as you read from only the indicated column(s) for each variable. When you added 3-5 that mean you were reading from columns 3 to 5. the + and leading 0 weren't need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another form of input is called "List" and assumes that values are separated by one or more characters defaulting to spaces.&lt;/P&gt;
&lt;P&gt;So&lt;/P&gt;
&lt;P&gt;input var1 $ var2;&lt;/P&gt;
&lt;P&gt;says the first variable is expected to&amp;nbsp;be 1 to 8 characters (the default for $,&amp;nbsp;you need to provide more info if reading longer)&amp;nbsp;character then after one or more spaces look for numeric value (length basically irrelevant though issues with more than 15 positions arise).&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 23:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619716#M8692</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-23T23:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: negative values not displaying during PROC PRINT</title>
      <link>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619911#M8693</link>
      <description>&lt;P&gt;Thank you so much. This is the explanation I was lacking. I appreciate your time and clarity.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 19:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/negative-values-not-displaying-during-PROC-PRINT/m-p/619911#M8693</guid>
      <dc:creator>eileencant</dc:creator>
      <dc:date>2020-01-24T19:22:13Z</dc:date>
    </item>
  </channel>
</rss>

