<?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: Help with a simple ods excel graph: Date time and a variable Free MSU in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/699001#M213818</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello, Arju1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understood you want to create a needle graph with date time in xaxis. If I was right, I'd create a &lt;/SPAN&gt;datetime variable (date_time) with a data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data msudatax; 
	set msudatax;
	date_time=dhms(date,0,0,time);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then I'd change proc sgplot for this one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data = work.msudatax ;
	needle x=date_time y=FreeMSU;
	format date_time datetime14. ;
	xaxis type= discrete display=(nolabel) fitpolicy=SPLIT splitchar=':';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This graph would be display&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jarapoch_0-1605472723991.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51695iCC03B20E3EDCDEF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jarapoch_0-1605472723991.png" alt="jarapoch_0-1605472723991.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I attach the full code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.msudatax;
infile datalines delimiter=',' missover firstobs=1 DSD;
input Date :ddmmyy10. Time:time. FreeMSU;
datalines;
14/11/2020,7:02:00.000,24
14/11/2020,7:07:00.000,24
14/11/2020,7:12:00.000,25
14/11/2020,7:17:00.000,-9
14/11/2020,7:22:00.000,23
15/11/2020,6:57:00.000,46
15/11/2020,7:02:00.000,48
15/11/2020,7:07:00.000,146
15/11/2020,7:12:00.000,146
15/11/2020,7:17:00.000,147
;
run;
data msudatax; 
	set msudatax;
	date_time=dhms(date,0,0,time);
run;

proc Contents data=work.msudatax;
run;

ods excel file="\temp.xlsx" options(sheet_name="gugus.xls");
	proc print data=work.msudatax (drop=date_time) noobs;
	title "MSU Report";
ods excel options(sheet_interval = 'proc' sheet_name = "MSU");

ods graphics / reset width = 6.4in height=4.8in imagemap;
proc sgplot data = work.msudatax ;
	needle x=date_time y=FreeMSU;
	format date_time datetime14. ;
	xaxis  type= discrete display=(nolabel) fitpolicy=SPLIT splitchar=':';
run;
ods graphics / reset;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Nov 2020 20:51:54 GMT</pubDate>
    <dc:creator>jarapoch</dc:creator>
    <dc:date>2020-11-15T20:51:54Z</dc:date>
    <item>
      <title>Help with a simple ods excel graph: Date time and a variable Free MSU</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/698941#M213797</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I need to create a graph of time on x-asis and temperature on y-axis. But my time variables are dependent on date. My Data is:&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Free MSU&lt;/P&gt;&lt;P&gt;14/11/2020&amp;nbsp; &amp;nbsp;7:02:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;24&lt;BR /&gt;14/11/2020&amp;nbsp; &amp;nbsp;7:07:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;24&lt;BR /&gt;14/11/2020&amp;nbsp; &amp;nbsp;7:12:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;25&lt;BR /&gt;14/11/2020&amp;nbsp; &amp;nbsp;7:17:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;-9&lt;BR /&gt;14/11/2020&amp;nbsp; &amp;nbsp;7:22:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;23&lt;/P&gt;&lt;P&gt;15/11/2020&amp;nbsp; &amp;nbsp;6:57:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;46&lt;BR /&gt;15/11/2020&amp;nbsp; &amp;nbsp;7:02:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;48&lt;BR /&gt;15/11/2020&amp;nbsp; &amp;nbsp;7:07:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;146&lt;BR /&gt;15/11/2020&amp;nbsp; &amp;nbsp;7:12:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;146&lt;BR /&gt;15/11/2020&amp;nbsp; &amp;nbsp;7:17:00.000&amp;nbsp; &amp;nbsp; &amp;nbsp;147&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using following SAS statements:&lt;/P&gt;&lt;P&gt;data work.msudatax;&lt;BR /&gt;infile 'd:\sasdata\charts\msudata.csv'&lt;BR /&gt;delimiter=','&lt;BR /&gt;missover&lt;BR /&gt;firstobs=2&lt;BR /&gt;DSD&lt;BR /&gt;lrecl = 32767&lt;BR /&gt;obs=290;&lt;BR /&gt;input Date:ddmmyy10. Time:time. FreeMSU TotalMSU;&lt;BR /&gt;format Date ddmmyy10. Time time8.7;&lt;BR /&gt;run;&lt;BR /&gt;proc Contents data=work.msudatax;&lt;BR /&gt;run;&lt;BR /&gt;ods excel file="E:\QXG\temp.xlsx" options(sheet_name="gugus.xls");&lt;BR /&gt;proc print data=work.msudatax noobs;&lt;BR /&gt;title "MSU Report";&lt;BR /&gt;ods excel options(sheet_interval = 'proc' sheet_name = "MSU");&lt;BR /&gt;ods graphics / reset width = 6.4in height=4.8in imagemap;&lt;BR /&gt;proc sgplot data = work.msudatax ;&lt;BR /&gt;needle x=Time y=FreeMSU / group=Date;&lt;BR /&gt;run;&lt;BR /&gt;ods graphics / reset;&lt;BR /&gt;ods excel close;&lt;/P&gt;&lt;P&gt;SAS&amp;nbsp; plots it but it plots as in the attached file. I need the time on x-axis starting from 7:02 of 14th till the time 7:17 of 15th.&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 09:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/698941#M213797</guid>
      <dc:creator>Arju1</dc:creator>
      <dc:date>2020-11-15T09:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a simple ods excel graph: Date time and a variable Free MSU</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/699001#M213818</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, Arju1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understood you want to create a needle graph with date time in xaxis. If I was right, I'd create a &lt;/SPAN&gt;datetime variable (date_time) with a data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data msudatax; 
	set msudatax;
	date_time=dhms(date,0,0,time);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then I'd change proc sgplot for this one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data = work.msudatax ;
	needle x=date_time y=FreeMSU;
	format date_time datetime14. ;
	xaxis type= discrete display=(nolabel) fitpolicy=SPLIT splitchar=':';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This graph would be display&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jarapoch_0-1605472723991.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51695iCC03B20E3EDCDEF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jarapoch_0-1605472723991.png" alt="jarapoch_0-1605472723991.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I attach the full code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.msudatax;
infile datalines delimiter=',' missover firstobs=1 DSD;
input Date :ddmmyy10. Time:time. FreeMSU;
datalines;
14/11/2020,7:02:00.000,24
14/11/2020,7:07:00.000,24
14/11/2020,7:12:00.000,25
14/11/2020,7:17:00.000,-9
14/11/2020,7:22:00.000,23
15/11/2020,6:57:00.000,46
15/11/2020,7:02:00.000,48
15/11/2020,7:07:00.000,146
15/11/2020,7:12:00.000,146
15/11/2020,7:17:00.000,147
;
run;
data msudatax; 
	set msudatax;
	date_time=dhms(date,0,0,time);
run;

proc Contents data=work.msudatax;
run;

ods excel file="\temp.xlsx" options(sheet_name="gugus.xls");
	proc print data=work.msudatax (drop=date_time) noobs;
	title "MSU Report";
ods excel options(sheet_interval = 'proc' sheet_name = "MSU");

ods graphics / reset width = 6.4in height=4.8in imagemap;
proc sgplot data = work.msudatax ;
	needle x=date_time y=FreeMSU;
	format date_time datetime14. ;
	xaxis  type= discrete display=(nolabel) fitpolicy=SPLIT splitchar=':';
run;
ods graphics / reset;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 20:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/699001#M213818</guid>
      <dc:creator>jarapoch</dc:creator>
      <dc:date>2020-11-15T20:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a simple ods excel graph: Date time and a variable Free MSU</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/699387#M213956</link>
      <description>Thank you very much. Works perfectly. Appreciate the help.</description>
      <pubDate>Tue, 17 Nov 2020 07:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-simple-ods-excel-graph-Date-time-and-a-variable-Free/m-p/699387#M213956</guid>
      <dc:creator>Arju1</dc:creator>
      <dc:date>2020-11-17T07:58:43Z</dc:date>
    </item>
  </channel>
</rss>

