<?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: ODS Export Date to Excel Properly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392282#M277751</link>
    <description>&lt;P&gt;There's no ODS code there...&lt;/P&gt;
&lt;P&gt;What version of SAS do you have? Before 9.4 TS1M3 ODS EXCEL was pre-production and had some issues,&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 16:48:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-08-31T16:48:53Z</dc:date>
    <item>
      <title>ODS Export Date to Excel Properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392280#M277750</link>
      <description>&lt;P&gt;This is probably simple, but I'm stuck I have, as part of a data set the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data gvars;
	%global leadvar sas_date sas_date_fs sas_date_fe conf_int data_source f_var yaxisformat;

	/* Data location library */
	call symput('data_source','NAVTS.NAV_DATA_ALL_TS');


	/* User entries below */
	sas_date_endhist='31Jul2017'd;
	sas_date_fcst_start='1Aug2017'd;
	sas_date_fcst_end='31Aug2018'd;
	conf_int_tmp=0.05;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to&amp;nbsp;do is to print the variable sas_date_endhist to an Excel file (preferably with ODS Excel)&amp;nbsp;and have SAS ensure Excel will read the date; Excel will use that date later. I would like only the month and year to be output from SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392280#M277750</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2017-08-31T16:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Export Date to Excel Properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392282#M277751</link>
      <description>&lt;P&gt;There's no ODS code there...&lt;/P&gt;
&lt;P&gt;What version of SAS do you have? Before 9.4 TS1M3 ODS EXCEL was pre-production and had some issues,&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392282#M277751</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-31T16:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Export Date to Excel Properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392288#M277752</link>
      <description>&lt;P&gt;Bah...sorry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;9.4 TS Level 1M3&lt;/P&gt;&lt;P&gt;EG 7.12 (7.100.2.3350) (64-bit)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS I had tried is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods excel file="R:\Traffic Forecasting\TFM 3.0\Hist Date.xlsx";&lt;BR /&gt;ods excel options(start_at="1,1" sheet_name="Date" sheet_interval="table" embedded_titles='no');&lt;BR /&gt;proc print data=gvars noobs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sas_date_endhist;&lt;BR /&gt;run;&lt;BR /&gt;ods excel close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But again I am not sure how to output just the month and year to a fromat Excel will honor.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392288#M277752</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2017-08-31T16:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Export Date to Excel Properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392291#M277753</link>
      <description>&lt;P&gt;Find the correct excel format and apply it with a TAGATTR style.&lt;/P&gt;
&lt;P&gt;Here's a paper on how that works - it's designed for ODS TAGSETS but pretty sure it works in ODS EXCEL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 17:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392291#M277753</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-31T17:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Export Date to Excel Properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392361#M277754</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; With ODS Excel and most regular SAS date formats, I find that I do NOT need TAGATTR. Here's an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testdate;
  infile datalines;
  input name $ date : mmddyy.;
  format date mmddyy10.;
return;
datalines;
alan 01/01/1960
barb 09/29/1950
carl 08/31/2017
;
run;

ods excel file='c:\temp\testdate.xlsx'
    options(sheet_interval='none' embedded_titles='yes');

title 'ODS EXCEL -- if use SAS format, TAGATTR might not be needed';
proc report data=testdate;
  compute before _page_ / style=Header;
    line '1) date is formatted mmddyy10.';
  endcomp;
run;
title;

proc report data=testdate;
  format date date9.;
  compute before _page_ / style=Header;
    line '2) use different format';
  endcomp;
run;


proc report data=testdate;
  format date worddate.;
  compute before _page_ / style=Header;
    line '3) use worddate format';
  endcomp;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;...and the output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="might_not_need_tagattr.png" style="width: 385px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/14769i6D35BA861E47FFD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="might_not_need_tagattr.png" alt="might_not_need_tagattr.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I love that my SAS Format is respected by Excel when I use ODS EXCEL - -I always have TAGATTR for custom dates, but this is a cool feature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 20:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Export-Date-to-Excel-Properly/m-p/392361#M277754</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-08-31T20:26:34Z</dc:date>
    </item>
  </channel>
</rss>

