[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: export sas with xlsx engine
From: Alan Churchill <savian.net () GMAIL ! COM>
Date: 2020-09-21 22:32:35
Message-ID: 047f01d69067$1b34ba80$519e2f80$ () gmail ! com
[Download RAW message or body]
This is a multipart message in MIME format.
This issue describes what I sent out on Sunday night regarding the utility I wrote. \
Sending to CSV or Excel is not a problem. It exports a SAS dataset with labels and \
formats as well as metadata (if desired). It currently uses csv but it is trvial to \
add Excel now that the labels and formats are handled.
Operation is:
ExportSasDataset.exe l "c:\mySasLib" -d "SHOES" -v -m -w "c:\work"
Thanks,
Alan Churchill
Savian
From: SAS(r) Discussion <SAS-L@LISTSERV.UGA.EDU> On Behalf Of Joe Matise
Sent: Monday, September 21, 2020 4:24 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: export sas with xlsx engine
That cannot retain formats. As far as I know there's no way to get the labels there \
either; you asked Chris H. this on a blog post a few years ago, and I don't believe \
the answer has changed. You'd need to use PROC EXPORT to get variable labels (but \
still, wouldn't work with formats).
-Joe
On Mon, Sep 21, 2020 at 4:56 PM Stanford Mwasongwe <smwasongwe@gmail.com \
<mailto:smwasongwe@gmail.com> > wrote:
How do I adjust the following code to make sure it retain the formats and variable \
labels name?
libname xlout XLSX 'H:\1-data\Excel\FINAL\EPINBS091720FINA2.xlsx';
data xlout.NBSEPI;
set WORK.EPINBS091720FINA2;
run;
libname xlout clear;
Thank you again
Stanford
__________________________________________________________________________________
<http://www.linkedin.com/pub/stanford-ernest-mwasongwe/27/2a0/861/> \
http://www.linkedin.com/pub/stanford-ernest-mwasongwe/27/2a0/861/
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Bookman Old Style";
panose-1:2 5 6 4 5 5 5 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span style='font-family:Consolas'>This issue \
describes what I sent out on Sunday night regarding the utility I wrote. Sending to \
CSV or Excel is not a problem. It exports a SAS dataset with labels and formats as \
well as metadata (if desired). It currently uses csv but it is trvial to add Excel \
now that the labels and formats are handled.<o:p></o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'>Operation is: \
<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal \
style='text-indent:.5in'><span style='font-family:Consolas'>ExportSasDataset.exe \
</span><span style='font-family:Consolas'>l "c:\mySasLib" -d \
"SHOES" -v -m -w "c:\work"<o:p></o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'><o:p> </o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'>Thanks,<o:p></o:p></span></p><p \
class=MsoNormal><span style='font-family:Consolas'>Alan \
Churchill<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-family:Consolas'>Savian<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-family:Consolas'><o:p> </o:p></span></p><div \
style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b>From:</b> SAS(r) Discussion <SAS-L@LISTSERV.UGA.EDU> <b>On \
Behalf Of </b>Joe Matise<br><b>Sent:</b> Monday, September 21, 2020 4:24 \
PM<br><b>To:</b> SAS-L@LISTSERV.UGA.EDU<br><b>Subject:</b> Re: export sas with xlsx \
engine<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p \
class=MsoNormal>That cannot retain formats. As far as I know there's no way to \
get the labels there either; you asked Chris H. this on a blog post a few years ago, \
and I don't believe the answer has changed. You'd need to use PROC EXPORT to \
get variable labels (but still, wouldn't work with formats).<o:p></o:p></p><div><p \
class=MsoNormal><o:p> </o:p></p></div><div><p \
class=MsoNormal>-Joe<o:p></o:p></p></div></div><p \
class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Mon, Sep 21, \
2020 at 4:56 PM Stanford Mwasongwe <<a \
href="mailto:smwasongwe@gmail.com">smwasongwe@gmail.com</a>> \
wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC \
1.0pt;padding:0in 0in 0in \
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><div><p \
class=MsoNormal><span style='font-family:"Verdana",sans-serif'>How do I adjust the \
following code to make sure it retain the formats and variable labels \
name?<o:p></o:p></span></p></div><div><div><p class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'>libname xlout XLSX \
'H:\1-data\Excel\FINAL\EPINBS091720FINA2.xlsx';<o:p></o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'> <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span style='font-family:"Verdana",sans-serif'>data \
xlout.NBSEPI;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'> set \
WORK.EPINBS091720FINA2;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'>run;<o:p></o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'> <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span style='font-family:"Verdana",sans-serif'>libname xlout \
clear;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-family:"Verdana",sans-serif'><o:p> </o:p></span></p></div><div><p \
class=MsoNormal><span style='font-family:"Verdana",sans-serif'>Thank you \
again<o:p></o:p></span></p></div></div><div><div><div><div><p \
class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Bookman Old \
Style",serif;color:#444444'>Stanford</span></b><o:p></o:p></p></div><div><p \
class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Bookman Old \
Style",serif;color:black'>__________________________________________________________________________________</span></b><span \
style='font-size:10.0pt;font-family:"Bookman Old \
Style",serif;color:black'> </span><span \
style='font-size:10.0pt;font-family:"Bookman Old \
Style",serif;color:blue'> </span><o:p></o:p></p></div><div><p class=MsoNormal><a \
href="http://www.linkedin.com/pub/stanford-ernest-mwasongwe/27/2a0/861/" \
target="_blank"><span \
style='font-size:10.0pt;font-family:"Verdana",sans-serif'>http://www.linkedin.com/pub/stanford-ernest-mwasongwe/27/2a0/861/</span></a><span \
style='font-size:10.0pt'><o:p></o:p></span></p></div></div></div></div></div></div></blockquote></div></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic