<?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: exportFromXL | Has any one used this Procedure? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282576#M59190</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;This has the added advantage that it will work under any operating system, except VMS and Z-OS.

Not much harder in Python. Note you can wrap %utl_submit_r in a macro and call it for every member in a folder.

%utl_submit_r(
  library(rio);
  convert('d:/xls/xls_class.xls','d:/csv/csv_class.csv');
);

"NAME","SEX","AGE","HEIGHT","WEIGHT"
"Alfred","M",14,69,112.5
"Alice","F",13,56.5,84
"Barbara","F",13,65.3,98
"Carol","F",14,62.8,102.5
"Henry","M",14,63.5,102.5
"James","M",12,57.3,83
"Jane","F",12,59.8,84.5
"Janet","F",15,62.5,112.5
"Jeffrey","M",13,62.5,84
"John","M",12,59,99.5
"Joyce","F",11,51.3,50.5
"Judy","F",14,64.3,90
"Louise","F",12,56.3,77
"Mary","F",15,66.5,112
"Philip","M",16,72,150
"Robert","M",12,64.8,128
"Ronald","M",15,67,133
"Thomas","M",11,57.5,85
"William","M",15,66.5,112

Note xls_class.xls is a self locating file

just take the first three characters for the folder name ie

xls/xls_class.xls


&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Jul 2016 23:32:48 GMT</pubDate>
    <dc:creator>rogerjdeangelis</dc:creator>
    <dc:date>2016-07-06T23:32:48Z</dc:date>
    <item>
      <title>exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282475#M59176</link>
      <description>&lt;P&gt;do any one know how to convert Excel sheets into Txt or CSv file, i searched internet and found one proc&lt;/P&gt;
&lt;P&gt;exportFromXL but unable to use it, has anyone used this before or know of someother procedure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282475#M59176</guid>
      <dc:creator>TestingSAS</dc:creator>
      <dc:date>2016-07-06T16:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282478#M59177</link>
      <description>&lt;P&gt;I think you mean the SAS macro called exportFromXL by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15110"&gt;@NateDerby﻿&lt;/a&gt;, which he &lt;A href="https://sourceforge.net/projects/exportfromxl/" target="_self"&gt;contributed to SourceForge here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not used it, but from what I read it uses DDE (dynamic data exchange) to automate Excel from SAS. &amp;nbsp;That mechanism works only when you have SAS for Windows and Microsoft Excel installed on the same machine. &amp;nbsp;So it won't work from SAS Enterprise Guide (usually) or with SAS that's installed on UNIX systems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways of using SAS to export data that you've imported from Excel. &amp;nbsp;And there are ways of automating Excel (using VB Script or Windows PowerShell) to export CSV files, independent of SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282478#M59177</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-07-06T16:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282479#M59178</link>
      <description>&lt;P&gt;thanks Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can u share some toher ways that i can use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my problem is that my business users are familar with Excel, so they gave me data in Excel only, but our SAS solution looks for Tab delimited files, so i have to convert the excel files before loading it into the solution, so looking for a simple steps t automate this step , i&amp;nbsp; am looking for a solution where in my Business users drop their excel files in one folder and then i run a utility to convert all the files to .txt files and the load it into SAS..&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282479#M59178</guid>
      <dc:creator>TestingSAS</dc:creator>
      <dc:date>2016-07-06T16:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282488#M59181</link>
      <description>&lt;P&gt;Here's a simple example of using VB Script to automate Excel and export a single sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;' constant that means "tab-delimited text"
Const txtFmt = -4158

WScript.Echo "Opening Excel"
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Visible = False
objExcel.Application.DisplayAlerts = False

Set objWorkbook = objExcel.Workbooks.Open("C:\temp\class.xlsx")
WScript.Echo "Saving as tab-delimited"
objExcel.ActiveWorkbook.SaveAs "C:\temp\class.txt", txtFmt, False
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit		&lt;/PRE&gt;
&lt;P&gt;Assuming you save that in a script called &lt;STRONG&gt;saveastext.vbs&lt;/STRONG&gt;, you would run with a command from Windows like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cscript c:\test\saveastext.vbs&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 17:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282488#M59181</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-07-06T17:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282493#M59184</link>
      <description>&lt;P&gt;can we also modify this script to accept excel work book with multiple sheets?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 17:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282493#M59184</guid>
      <dc:creator>TestingSAS</dc:creator>
      <dc:date>2016-07-06T17:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282494#M59185</link>
      <description>&lt;P&gt;Of course you can -- but that's a VBA or VBS question, and some more internet searches should yield some examples. &amp;nbsp;I have some success by using the Developer tab in Excel to record a macro, which captures a script of your actions in Excel. &amp;nbsp;You can then use this as a part of your final script.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 17:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282494#M59185</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-07-06T17:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: exportFromXL | Has any one used this Procedure?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282576#M59190</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;This has the added advantage that it will work under any operating system, except VMS and Z-OS.

Not much harder in Python. Note you can wrap %utl_submit_r in a macro and call it for every member in a folder.

%utl_submit_r(
  library(rio);
  convert('d:/xls/xls_class.xls','d:/csv/csv_class.csv');
);

"NAME","SEX","AGE","HEIGHT","WEIGHT"
"Alfred","M",14,69,112.5
"Alice","F",13,56.5,84
"Barbara","F",13,65.3,98
"Carol","F",14,62.8,102.5
"Henry","M",14,63.5,102.5
"James","M",12,57.3,83
"Jane","F",12,59.8,84.5
"Janet","F",15,62.5,112.5
"Jeffrey","M",13,62.5,84
"John","M",12,59,99.5
"Joyce","F",11,51.3,50.5
"Judy","F",14,64.3,90
"Louise","F",12,56.3,77
"Mary","F",15,66.5,112
"Philip","M",16,72,150
"Robert","M",12,64.8,128
"Ronald","M",15,67,133
"Thomas","M",11,57.5,85
"William","M",15,66.5,112

Note xls_class.xls is a self locating file

just take the first three characters for the folder name ie

xls/xls_class.xls


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 23:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exportFromXL-Has-any-one-used-this-Procedure/m-p/282576#M59190</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-07-06T23:32:48Z</dc:date>
    </item>
  </channel>
</rss>

