<?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 How do I import Excel files in Data Integration Studio? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323216#M9318</link>
    <description>&lt;P&gt;I am using&amp;nbsp;Data Integration Studio 4.9 and I need to import an Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ve seen that my predecessor did it via -&amp;gt; New -&amp;gt; External File -&amp;gt; User Written.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes he used something like this:&lt;/P&gt;&lt;PRE&gt;Libname Excel3 XLSX "D:\TimeMattersDWH\Import\Startrax\Steuertabelle.xlsx";

data &amp;amp;_Output.(where=(not missing(partner_no_)));
length
station $ 100
Location_Code $ 10
partner_no_ $ 25
partner_name $ 100
flat_km_limit 8
courier_flat 8
km_surcharge 8
km_surch_nwh 8
late 8
weekend 8
currency $ 10
valid_from 8
valid_to 8
time_from 8
time_to 8
days 8
Last_Updated 8
Updated_By $ 6
Schriftliche_Vereinbarung_abgele $ 3
Status_Comment___Bearbeiter $ 70 ;
set Excel3."Courier Partner"n ;
partner_no_ = VAR3;
partner_name = Partner__Name;
flat_km_limit = VAR5;
courier_flat = VAR6;
km_surcharge = km__surcharge;
km_surch_nwh = VAR8;
valid_from = Valid__From;
valid_to = Valid__To;
time_from = Time__from;
time_to = Time__to;
keep station 
Location_Code
partner_no_
partner_name
flat_km_limit
courier_flat
km_surcharge
km_surch_nwh
late
weekend
currency 
valid_from 
valid_to 
time_from 
time_to 
days 
Last_Updated 
Updated_By 
Schriftliche_Vereinbarung_abgele 
Status_Comment___Bearbeiter ; 
run;
Libname Excel3;&lt;/PRE&gt;&lt;P&gt;Sometimes just this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Libname XLSTRAPT XLSX "D:\TimeMattersDWH\Import\Startrax\Tracking_Punkte.xlsx";

Proc SQL;
	Create Table &amp;amp;_Output. As
		Select *
			From XLSTRAPT.DisplayOptions
			Where not missing(TrackingPointID);
Quit;

Libname XLSTRAPT;&lt;/PRE&gt;&lt;P&gt;My first question is,&lt;/P&gt;&lt;P&gt;when do I use XLSTRAPT and when Excel3? What is the difference even?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes there is every field listed, with FORMAT, LENGTH, etc. and sometimes its just a simple PROC SQL SELECT *...&lt;/P&gt;&lt;P&gt;How do I know which one to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put an Excel sheet into Enterprise Guide, I think I can use the generated code as file parameter in the external file's properties, but I cant get that to work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really lost here and I have no clue where to start...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone point me please to the solution?&lt;/P&gt;&lt;P&gt;I ve attached the Excel file to this thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jan 2017 13:23:32 GMT</pubDate>
    <dc:creator>dirks</dc:creator>
    <dc:date>2017-01-08T13:23:32Z</dc:date>
    <item>
      <title>How do I import Excel files in Data Integration Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323216#M9318</link>
      <description>&lt;P&gt;I am using&amp;nbsp;Data Integration Studio 4.9 and I need to import an Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ve seen that my predecessor did it via -&amp;gt; New -&amp;gt; External File -&amp;gt; User Written.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes he used something like this:&lt;/P&gt;&lt;PRE&gt;Libname Excel3 XLSX "D:\TimeMattersDWH\Import\Startrax\Steuertabelle.xlsx";

data &amp;amp;_Output.(where=(not missing(partner_no_)));
length
station $ 100
Location_Code $ 10
partner_no_ $ 25
partner_name $ 100
flat_km_limit 8
courier_flat 8
km_surcharge 8
km_surch_nwh 8
late 8
weekend 8
currency $ 10
valid_from 8
valid_to 8
time_from 8
time_to 8
days 8
Last_Updated 8
Updated_By $ 6
Schriftliche_Vereinbarung_abgele $ 3
Status_Comment___Bearbeiter $ 70 ;
set Excel3."Courier Partner"n ;
partner_no_ = VAR3;
partner_name = Partner__Name;
flat_km_limit = VAR5;
courier_flat = VAR6;
km_surcharge = km__surcharge;
km_surch_nwh = VAR8;
valid_from = Valid__From;
valid_to = Valid__To;
time_from = Time__from;
time_to = Time__to;
keep station 
Location_Code
partner_no_
partner_name
flat_km_limit
courier_flat
km_surcharge
km_surch_nwh
late
weekend
currency 
valid_from 
valid_to 
time_from 
time_to 
days 
Last_Updated 
Updated_By 
Schriftliche_Vereinbarung_abgele 
Status_Comment___Bearbeiter ; 
run;
Libname Excel3;&lt;/PRE&gt;&lt;P&gt;Sometimes just this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Libname XLSTRAPT XLSX "D:\TimeMattersDWH\Import\Startrax\Tracking_Punkte.xlsx";

Proc SQL;
	Create Table &amp;amp;_Output. As
		Select *
			From XLSTRAPT.DisplayOptions
			Where not missing(TrackingPointID);
Quit;

Libname XLSTRAPT;&lt;/PRE&gt;&lt;P&gt;My first question is,&lt;/P&gt;&lt;P&gt;when do I use XLSTRAPT and when Excel3? What is the difference even?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes there is every field listed, with FORMAT, LENGTH, etc. and sometimes its just a simple PROC SQL SELECT *...&lt;/P&gt;&lt;P&gt;How do I know which one to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put an Excel sheet into Enterprise Guide, I think I can use the generated code as file parameter in the external file's properties, but I cant get that to work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really lost here and I have no clue where to start...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone point me please to the solution?&lt;/P&gt;&lt;P&gt;I ve attached the Excel file to this thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 13:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323216#M9318</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-01-08T13:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import Excel files in Data Integration Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323221#M9319</link>
      <description>First, I usually try as hard as possible let not to involve Excel in DI due to their flexible nature,  which causes headache for maintenance. &lt;BR /&gt;That said, I would prefer not to use an External File, rather an Excel Library registration. I don't have DIS at my fingertips so I can't give you the exact steps, but it's covered in the documentation as well in several papers.</description>
      <pubDate>Sun, 08 Jan 2017 15:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323221#M9319</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-01-08T15:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import Excel files in Data Integration Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323222#M9320</link>
      <description>&lt;P&gt;Idea is you create a library to point to the Excel file. Because there are many different file types you specify the DBMS= XLSX &amp;nbsp;so SAS know you're working with an Excel file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format for a libname is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME pointer&amp;nbsp;DBMS 'path to file';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pointer can be anything less than 8 chars, not starting with a number. In your case they used Excel3 and xlstart. It could easily be any text, that's just the library name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Libname vs GUI - code and libname are easier to control, change and use in other SAS programs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 17:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323222#M9320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-08T17:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import Excel files in Data Integration Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323227#M9321</link>
      <description>&lt;P&gt;With DIS you need stable table structures which is something Excel doesn't provide (i.e. defined lengths for character variables). I therefore always advise against using Excel as data source; but I know of course that sometimes things just are as they are...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm normally doing with Excel sources is to first convert them to a text file and if there are multiple sources then I'd implement this conversion as a custom transformation where I then just pass in input path, workbook, sheet name and eventually Range, output pathname and filename (using Proc Export in the code section of the custom transformation).&lt;/P&gt;
&lt;P&gt;I also tend to implement this conversion step in a DIS job on its own to keep "the mess" separated from my "clean" DIS processes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you've created the text file you can create external file metadata with all the variables and attributes well defined on SAS Metadata level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 20:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-import-Excel-files-in-Data-Integration-Studio/m-p/323227#M9321</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-08T20:51:40Z</dc:date>
    </item>
  </channel>
</rss>

