<?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 Data Chart Problem in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925297#M11245</link>
    <description>&lt;P&gt;Hello, I am having problems with my data. I have my code below and when I do to my data table not all the numbers are correct under the weight column. Any ideas what I did wrong? Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Itsmadz5_1-1713825689444.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95759i2CFBE6CF9CEAC7F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Itsmadz5_1-1713825689444.png" alt="Itsmadz5_1-1713825689444.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Itsmadz5_0-1713825640197.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95760iEF59626B7419240D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Itsmadz5_0-1713825640197.png" alt="Itsmadz5_0-1713825640197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 22:51:20 GMT</pubDate>
    <dc:creator>Itsmadz5</dc:creator>
    <dc:date>2024-04-22T22:51:20Z</dc:date>
    <item>
      <title>Data Chart Problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925297#M11245</link>
      <description>&lt;P&gt;Hello, I am having problems with my data. I have my code below and when I do to my data table not all the numbers are correct under the weight column. Any ideas what I did wrong? Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Itsmadz5_1-1713825689444.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95759i2CFBE6CF9CEAC7F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Itsmadz5_1-1713825689444.png" alt="Itsmadz5_1-1713825689444.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Itsmadz5_0-1713825640197.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95760iEF59626B7419240D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Itsmadz5_0-1713825640197.png" alt="Itsmadz5_0-1713825640197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 22:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925297#M11245</guid>
      <dc:creator>Itsmadz5</dc:creator>
      <dc:date>2024-04-22T22:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data Chart Problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925322#M11246</link>
      <description>&lt;P&gt;If you don't define a length,&amp;nbsp; a char variable can only store eight chars.&lt;/P&gt;
&lt;P&gt;To read a date you have to define a numeric variable and use informat and format statements.&lt;/P&gt;
&lt;P&gt;If you need more assistance, please provide code as text, insert it using the running-man-button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 06:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925322#M11246</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2024-04-23T06:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Data Chart Problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925381#M11247</link>
      <description>&lt;P&gt;I'm too lazy to type more than a couple lines of data so lets examine what happens:&lt;/P&gt;
&lt;PRE&gt;data junk;
   input trt $ date $ weight;
datalines;
1 11/17/2023 61.40833333
1 12/1/2023 60.875
;&lt;/PRE&gt;
&lt;P&gt;simple Proc print shows:&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&lt;A name="IDX1" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set USER.JUNK" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;trt&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;date&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;weight&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;11/17/20&lt;/TD&gt;
&lt;TD class="r data"&gt;61.4083&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;12/1/202&lt;/TD&gt;
&lt;TD class="r data"&gt;
&lt;P&gt;60.8750&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt; said the default length of the character variables is limited to 8 so they get truncated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution for the date values is to read them as a date value. If you want people to understand the dates then assign a format that people will understand. Like&lt;/P&gt;
&lt;PRE&gt;data junk;
   input trt $ date :mmddyy10. weight;
   format date mmddyy10.;

datalines;
1 11/17/2023 61.40833333
1 12/1/2023 60.875
;&lt;/PRE&gt;
&lt;P&gt;Which when printed&lt;/P&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&lt;A name="IDX9" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set USER.JUNK" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;trt&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;date&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;weight&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;11/17/2023&lt;/TD&gt;
&lt;TD class="r data"&gt;61.4083&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;12/01/2023&lt;/TD&gt;
&lt;TD class="r data"&gt;60.8750&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The format affects the display of the numeric values as well. Proc Print defaults to a "usable" format but may not display all the digits.&lt;/P&gt;
&lt;P&gt;You can force different appearance with different formats. For example this forces the display to use 8 decimals&lt;/P&gt;
&lt;PRE&gt;Proc print data=junk noobs;
   format weight f15.8;
run;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&lt;A name="IDX10" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set USER.JUNK" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;trt&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;date&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;weight&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;11/17/2023&lt;/TD&gt;
&lt;TD class="r data"&gt;61.40833333&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;12/01/2023&lt;/TD&gt;
&lt;TD class="r data"&gt;60.87500000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Note that there is a limit to the precision of numbers stored in SAS and depending on your system 14 or 15 decimal points are going to push it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATE values really should use one of the date informats and assign a desired appearance date format. Note that the groups created by an assigned format are generally valid for reporting, analysis and many graphing tasks. So you can change a report to reflect Year, Year and Month,&amp;nbsp; Year and quarter, Year and week just by changing the format in a procedure.&lt;/P&gt;
&lt;P&gt;Once you have actual dates (and datetime or time values) there are functions to extract bits like Year, Month, Day, Hour etc, plus determine the number of intervals between values or to increment values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt; has a PDF with much information about dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Apr 2024 14:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Data-Chart-Problem/m-p/925381#M11247</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-23T14:00:14Z</dc:date>
    </item>
  </channel>
</rss>

