<?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: import mutiple sheets XML spreadsheet and Excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236133#M43241</link>
    <description>&lt;P&gt;Here is one way to get the tabs imported. In this example, I've used a xls with 3 tabs named TAB1,TAB2 and TAB3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The Excel sheet is attached below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro xlfile(file);
proc import out= &amp;amp;file
    datafile = '/folders/myfolders/data/SASTABSv5.xls'
    dbms = xls;
    sheet = "&amp;amp;file";
    getnames = yes;
run;
%mend xlfile;
%xlfile(TAB1);
%xlfile(TAB2);
%xlfile(TAB3);

proc contents data=work._all_;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the log for your reference:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 55         
 56         %macro xlfile(file);
 57         proc import out= &amp;amp;file
 58             datafile = '/folders/myfolders/data/SASTABSv5.xls'
 59             dbms = xls;
 60             sheet = "&amp;amp;file";
 61             getnames = yes;
 62         run;
 63         %mend xlfile;
 64         %xlfile(TAB1);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB1 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 65         %xlfile(TAB2);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB2 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 66         %xlfile(TAB3);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB3 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 67         
 68         proc contents data=work._all_;
 69         
 70         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 82         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And, here is the output...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;The CONTENTS Procedure
Directory
Libref	WORK
Engine	V9
Physical Name	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain
Inode Number	275783
Access Permission	rwx------
Owner Name	sasdemo
File Size	4KB
File Size (bytes)	4096
#	Name	Member Type	File Size	Last Modified
1	REGSTRY	ITEMSTOR	32KB	11/24/2015 05:29:06
2	SASGOPT	CATALOG	12KB	11/24/2015 06:31:55
3	SASMAC1	CATALOG	188KB	11/24/2015 05:29:07
4	TAB1	DATA	128KB	11/24/2015 06:42:37
5	TAB2	DATA	128KB	11/24/2015 06:42:37
6	TAB3	DATA	128KB	11/24/2015 06:42:37
The CONTENTS Procedure
Data Set Name	WORK.TAB1	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab1.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275959
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
1	A	Char	12	$12.	$12.	A
2	B	Num	8	BEST12.	 	B
The CONTENTS Procedure
Data Set Name	WORK.TAB2	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab2.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275960
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
2	B	Num	8	BEST12.	 	B
1	D	Char	12	$12.	$12.	D
The CONTENTS Procedure
Data Set Name	WORK.TAB3	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab3.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275961
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
2	B	Num	8	BEST12.	 	B
1	G	Char	12	$12.	$12.	G&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps you.... Good Luck...!!!&lt;/P&gt;</description>
    <pubDate>Tue, 24 Nov 2015 06:48:26 GMT</pubDate>
    <dc:creator>kannand</dc:creator>
    <dc:date>2015-11-24T06:48:26Z</dc:date>
    <item>
      <title>import mutiple sheets XML spreadsheet and Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236129#M43240</link>
      <description>&lt;P&gt;Dear user,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am trying to import multiple sheets XML spread sheet and excle file in to data sets (one sheet for one data set) by using below methods&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-proc imoprt&lt;/P&gt;
&lt;P&gt;-ods tagsets&lt;/P&gt;
&lt;P&gt;-libname&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how ever i am unable to create data sets, can any one help me to resolve this issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regars,&lt;/P&gt;
&lt;P&gt;Rajasekhar Reddy&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 06:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236129#M43240</guid>
      <dc:creator>RajasekharReddy</dc:creator>
      <dc:date>2015-11-24T06:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: import mutiple sheets XML spreadsheet and Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236133#M43241</link>
      <description>&lt;P&gt;Here is one way to get the tabs imported. In this example, I've used a xls with 3 tabs named TAB1,TAB2 and TAB3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The Excel sheet is attached below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro xlfile(file);
proc import out= &amp;amp;file
    datafile = '/folders/myfolders/data/SASTABSv5.xls'
    dbms = xls;
    sheet = "&amp;amp;file";
    getnames = yes;
run;
%mend xlfile;
%xlfile(TAB1);
%xlfile(TAB2);
%xlfile(TAB3);

proc contents data=work._all_;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the log for your reference:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 55         
 56         %macro xlfile(file);
 57         proc import out= &amp;amp;file
 58             datafile = '/folders/myfolders/data/SASTABSv5.xls'
 59             dbms = xls;
 60             sheet = "&amp;amp;file";
 61             getnames = yes;
 62         run;
 63         %mend xlfile;
 64         %xlfile(TAB1);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB1 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 65         %xlfile(TAB2);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB2 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 66         %xlfile(TAB3);
 
 NOTE: The import data set has 2 observations and 2 variables.
 NOTE: WORK.TAB3 data set was successfully created.
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 67         
 68         proc contents data=work._all_;
 69         
 70         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 82         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And, here is the output...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;The CONTENTS Procedure
Directory
Libref	WORK
Engine	V9
Physical Name	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain
Inode Number	275783
Access Permission	rwx------
Owner Name	sasdemo
File Size	4KB
File Size (bytes)	4096
#	Name	Member Type	File Size	Last Modified
1	REGSTRY	ITEMSTOR	32KB	11/24/2015 05:29:06
2	SASGOPT	CATALOG	12KB	11/24/2015 06:31:55
3	SASMAC1	CATALOG	188KB	11/24/2015 05:29:07
4	TAB1	DATA	128KB	11/24/2015 06:42:37
5	TAB2	DATA	128KB	11/24/2015 06:42:37
6	TAB3	DATA	128KB	11/24/2015 06:42:37
The CONTENTS Procedure
Data Set Name	WORK.TAB1	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab1.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275959
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
1	A	Char	12	$12.	$12.	A
2	B	Num	8	BEST12.	 	B
The CONTENTS Procedure
Data Set Name	WORK.TAB2	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab2.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275960
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
2	B	Num	8	BEST12.	 	B
1	D	Char	12	$12.	$12.	D
The CONTENTS Procedure
Data Set Name	WORK.TAB3	Observations	2
Member Type	DATA	Variables	2
Engine	V9	Indexes	0
Created	11/24/2015 01:42:37	Observation Length	24
Last Modified	11/24/2015 01:42:37	Deleted Observations	0
Protection	 	Compressed	NO
Data Set Type	 	Sorted	NO
Label	 	 	 
Data Representation	SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64	 	 
Encoding	utf-8 Unicode (UTF-8)	 	 
Engine/Host Dependent Information
Data Set Page Size	65536
Number of Data Set Pages	1
First Data Page	1
Max Obs per Page	2714
Obs in First Data Page	2
Number of Data Set Repairs	0
Filename	/tmp/SAS_workA7D900000D63_localhost.localdomain/SAS_workBA9100000D63_localhost.localdomain/tab3.sas7bdat
Release Created	9.0401M3
Host Created	Linux
Inode Number	275961
Access Permission	rw-rw-r--
Owner Name	sasdemo
File Size	128KB
File Size (bytes)	131072
Alphabetic List of Variables and Attributes
#	Variable	Type	Len	Format	Informat	Label
2	B	Num	8	BEST12.	 	B
1	G	Char	12	$12.	$12.	G&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps you.... Good Luck...!!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 06:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236133#M43241</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-24T06:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: import mutiple sheets XML spreadsheet and Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236153#M43248</link>
      <description>&lt;P&gt;Please clarify what you mean by "&lt;SPAN&gt;how ever i am unable to create data sets,". &amp;nbsp;What is the problem, is there something in the log? &amp;nbsp;Are you unsure of the code? &amp;nbsp;What have you tried? &amp;nbsp;What does the file look like, is it an Excel file (i.e. is it XLSX), sample would be helpful.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 09:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236153#M43248</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-24T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: import mutiple sheets XML spreadsheet and Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236223#M43269</link>
      <description>ODS Tagsets is used for exporting data, not importing data. &lt;BR /&gt;&lt;BR /&gt;Proc Import and Libname methods may work, assuming you have the correct license, in this case SAS/Access.</description>
      <pubDate>Tue, 24 Nov 2015 16:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-mutiple-sheets-XML-spreadsheet-and-Excel-file/m-p/236223#M43269</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-24T16:49:53Z</dc:date>
    </item>
  </channel>
</rss>

