<?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: Outputting to Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57943#M12582</link>
    <description>I have one question .how can I output a SAS data set in MVS(Mainframe) to excel sheet . ?</description>
    <pubDate>Tue, 22 Sep 2009 06:27:43 GMT</pubDate>
    <dc:creator>er_awasthi</dc:creator>
    <dc:date>2009-09-22T06:27:43Z</dc:date>
    <item>
      <title>Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57939#M12578</link>
      <description>Hello. I use the following code to write out 4 columns from a sas dataset (named "approval") into Excel.&lt;BR /&gt;
&lt;BR /&gt;
filename data dde "excel|Data!r2c1:r65536c4";&lt;BR /&gt;
data _null_; &lt;BR /&gt;
file data notab; &lt;BR /&gt;
set approval;  &lt;BR /&gt;
put	lsrpid '09'x&lt;BR /&gt;
	lsmfid '09'x&lt;BR /&gt;
	aeantx '09'x&lt;BR /&gt;
	ltmfrn '09'x;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The first two fields are numeric; the last two are character. There are a few issues when the fields are written into Excel:&lt;BR /&gt;
&lt;BR /&gt;
1) The character fields all get an extra space added on the end, I don't want the extra space&lt;BR /&gt;
2) If the character string is empty SAS outputs 2 spaces, I want the cell to be empty&lt;BR /&gt;
3) If the numeric value is missing SAS outputs a ".", I want the cell to be empty&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help?&lt;BR /&gt;
Thanks&lt;BR /&gt;
James</description>
      <pubDate>Thu, 23 Jul 2009 10:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57939#M12578</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-23T10:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57940#M12579</link>
      <description>Hi!&lt;BR /&gt;
Try this code.&lt;BR /&gt;
&lt;BR /&gt;
 data approval;&lt;BR /&gt;
 infile cards dlm=',' missover;&lt;BR /&gt;
 input lsrpid lsmfid aeantx $ ltmfrn $;&lt;BR /&gt;
 cards;&lt;BR /&gt;
 10, 9, asdsdf,&lt;BR /&gt;
 11, 12, , nnfjkgk&lt;BR /&gt;
 16, .,  ,  ppfdkk&lt;BR /&gt;
 .,  ., djfu4, kflld&lt;BR /&gt;
 ;&lt;BR /&gt;
&lt;BR /&gt;
 filename data dde "excel|Data!r2c1:r65536c10";&lt;BR /&gt;
&lt;BR /&gt;
 data _null_;&lt;BR /&gt;
 file data notab  ;&lt;BR /&gt;
 set approval;&lt;BR /&gt;
 if lsrpid=. then put '09'x @; else put lsrpid '09'x @;&lt;BR /&gt;
 if lsmfid=. then put '09'x @; else put lsrpid '09'x @;&lt;BR /&gt;
 if aeantx='' then put '09'x @; else do; do j=1 to length(aeantx);d=Substr(aeantx,j,1);Put d $1.@;end; put '09'x @; end;&lt;BR /&gt;
 if ltmfrn='' then put '09'x @ ; else do j=1 to length(ltmfrn);d=Substr(ltmfrn,j,1);Put d $1.@;end; put '09'x;&lt;BR /&gt;
 run;</description>
      <pubDate>Thu, 23 Jul 2009 11:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57940#M12579</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2009-07-23T11:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57941#M12580</link>
      <description>There are some updates in code.&lt;BR /&gt;
&lt;BR /&gt;
 data approval;&lt;BR /&gt;
 infile cards dlm=',' missover;&lt;BR /&gt;
 input lsrpid lsmfid aeantx $ ltmfrn $;&lt;BR /&gt;
 cards;&lt;BR /&gt;
 10, 9, asdsdf,&lt;BR /&gt;
 11, 12, , nnfjkgk&lt;BR /&gt;
 16, .,  ,  ppfdkk&lt;BR /&gt;
 .,  ., djfu4, kflld&lt;BR /&gt;
  , , ,&lt;BR /&gt;
 66, 79, plf,&lt;BR /&gt;
 89,78,,&lt;BR /&gt;
 ;&lt;BR /&gt;
&lt;BR /&gt;
 filename data dde "excel|Data!r2c1:r65536c10";&lt;BR /&gt;
&lt;BR /&gt;
 data _null_;&lt;BR /&gt;
 file data notab  ;&lt;BR /&gt;
 set approval;&lt;BR /&gt;
 if lsrpid=. then put '09'x @; else put lsrpid '09'x @;&lt;BR /&gt;
 if lsmfid=. then put '09'x @; else put lsmfid '09'x @;&lt;BR /&gt;
 if aeantx='' then put '09'x @; else do; do j=1 to length(aeantx);d=Substr(aeantx,j,1);Put d $1.@;end; put '09'x @; end;&lt;BR /&gt;
 if ltmfrn='' then put '09'x  ; else do; do j=1 to length(ltmfrn);d=Substr(ltmfrn,j,1);Put d $1.@;end; put '09'x; end;&lt;BR /&gt;
 run;</description>
      <pubDate>Thu, 23 Jul 2009 12:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57941#M12580</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2009-07-23T12:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57942#M12581</link>
      <description>Perfect!&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much for your help!&lt;BR /&gt;
&lt;BR /&gt;
J</description>
      <pubDate>Thu, 23 Jul 2009 13:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57942#M12581</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-23T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57943#M12582</link>
      <description>I have one question .how can I output a SAS data set in MVS(Mainframe) to excel sheet . ?</description>
      <pubDate>Tue, 22 Sep 2009 06:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57943#M12582</guid>
      <dc:creator>er_awasthi</dc:creator>
      <dc:date>2009-09-22T06:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57944#M12583</link>
      <description>See this document from the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, located using the site SEARCH facility, using z/OS instead of MVS (there are other similar documents at the support site that may be helpful to your interest here):&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/base/ods/templateFAQ/MVSODS3.pdf" target="_blank"&gt;http://support.sas.com/rnd/base/ods/templateFAQ/MVSODS3.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 22 Sep 2009 10:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputting-to-Excel/m-p/57944#M12583</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-22T10:23:59Z</dc:date>
    </item>
  </channel>
</rss>

