<?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: Range of using Proc Import xlsx format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335335#M272329</link>
    <description>&lt;P&gt;It is reading the file but not the number columns and rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 			out  		= bal_&amp;amp;var1 
    					datafile 	= '/TEST/DVR_V1_PROD_01182017.xlsx'
    					dbms 		= xlsx replace;
						sheet		= "&amp;amp;var1";
						range		="&amp;amp;var1..$A1:G26";	


********************************************LOG*************************************
MPRINT(IMPORT_LOOP):   range ="M00_ACCT_BALANCE_AM.$A1:G26";
6                                                          The SAS System                          07:50 Thursday, February 23, 2017

MPRINT(IMPORT_LOOP):   getnames = yes;
MPRINT(IMPORT_LOOP):   run;

NOTE: The import data set has 25 observations and 9 variables.
NOTE: WORK.BAL_M00_ACCT_BAL_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      
MPRINT(IMPORT_LOOP):   sheet = "M00_ACCT_CR_LM_AM";
SYMBOLGEN:  Macro variable VAR2 resolves to M00_ACCT_CREDIT_LIMIT_AM
MPRINT(IMPORT_LOOP):   range ="M00_ACCT_CR_LM_AM.$A1:G26";
MPRINT(IMPORT_LOOP):   getnames = yes;
MPRINT(IMPORT_LOOP):   run;

NOTE: The import data set has 52 observations and 10 variables.
NOTE: WORK.CR_M00_ACCT_CR_LM_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2017 16:16:17 GMT</pubDate>
    <dc:creator>Jcorti</dc:creator>
    <dc:date>2017-02-23T16:16:17Z</dc:date>
    <item>
      <title>Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335299#M272325</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It ia a big mess import Excel files to SAS data sets.&lt;/P&gt;&lt;P&gt;When I am selecting a range, I am selecting the range that contains 26 rows and 8 columns shown here &amp;nbsp;--&amp;gt; $A1:G26&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;options validvarname=any;
%let var1=M&amp;amp;i._ACCT_BALANCE_AM;

proc import 			out  		= bal_&amp;amp;var1
    					datafile 	= '/TEST/DVR/DVR_V1_PROD_01182017.xlsx'
    					dbms 		= xlsx replace;
    					sheet		= "&amp;amp;var1";	
					range		="&amp;amp;var1.$A1:G26";	
    					getnames 	= yes;

 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the log is telling me other thing:&lt;/P&gt;&lt;P&gt;It is reading 9 variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The import data set has 25 observations and 9 variables.
NOTE: WORK.BAL_M00_ACCT_BALANCE_AM data set was successfully created.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is another example with another variable that I have defined in the same way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The import data set has 52 observations and 10 variables.
NOTE: WORK.CR_M00_ACCT_CREDIT_LIMIT_AM data set was successfully created.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have 2 questions:&lt;/P&gt;&lt;P&gt;1.- Why is not reading 8 columns and 26 rows &amp;nbsp;defined on my RANGE statement?&lt;/P&gt;&lt;P&gt;2.- How can I fix this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;JC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 15:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335299#M272325</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-02-23T15:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335304#M272326</link>
      <description>&lt;P&gt;Have you tried to add single quotes?&lt;/P&gt;
&lt;P&gt;As in&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;range = "'&amp;amp;var1.$A1:G26'";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I took this from&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This also suggests to omit sheet= when specifying a range.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 15:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335304#M272326</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-23T15:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335309#M272327</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me try!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 15:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335309#M272327</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-02-23T15:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335325#M272328</link>
      <description>&lt;P&gt;I would add an extra period in the range statement. i.e.,&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;		&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"&amp;amp;var1..$A1:G26"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 15:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335325#M272328</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-23T15:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335335#M272329</link>
      <description>&lt;P&gt;It is reading the file but not the number columns and rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 			out  		= bal_&amp;amp;var1 
    					datafile 	= '/TEST/DVR_V1_PROD_01182017.xlsx'
    					dbms 		= xlsx replace;
						sheet		= "&amp;amp;var1";
						range		="&amp;amp;var1..$A1:G26";	


********************************************LOG*************************************
MPRINT(IMPORT_LOOP):   range ="M00_ACCT_BALANCE_AM.$A1:G26";
6                                                          The SAS System                          07:50 Thursday, February 23, 2017

MPRINT(IMPORT_LOOP):   getnames = yes;
MPRINT(IMPORT_LOOP):   run;

NOTE: The import data set has 25 observations and 9 variables.
NOTE: WORK.BAL_M00_ACCT_BAL_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      
MPRINT(IMPORT_LOOP):   sheet = "M00_ACCT_CR_LM_AM";
SYMBOLGEN:  Macro variable VAR2 resolves to M00_ACCT_CREDIT_LIMIT_AM
MPRINT(IMPORT_LOOP):   range ="M00_ACCT_CR_LM_AM.$A1:G26";
MPRINT(IMPORT_LOOP):   getnames = yes;
MPRINT(IMPORT_LOOP):   run;

NOTE: The import data set has 52 observations and 10 variables.
NOTE: WORK.CR_M00_ACCT_CR_LM_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335335#M272329</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-02-23T16:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335339#M272330</link>
      <description>&lt;P&gt;Try without sheet=, you already have the sheet name in your range specification.&lt;/P&gt;
&lt;P&gt;Since the &lt;U&gt;dollar sign&lt;/U&gt; is the separator between sheet name and range, the second period in the range specification is unnecessary and probably wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335339#M272330</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-23T16:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335342#M272331</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;that my suggestion of adding the period was incorrect in this situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you use the Excel engine. It seems to work correctly with your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let var1=Sheet1;
proc import 			out = bal_&amp;amp;var1 
    				datafile = '/TEST/DVR_V1_PROD_01182017.xlsx'
    				dbms = excel replace;
				range ="&amp;amp;var1.$A1:G26";
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 16:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335342#M272331</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-23T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335348#M272332</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: DBMS type EXCEL not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is a big mess!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335348#M272332</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-02-23T17:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335353#M272333</link>
      <description>&lt;P&gt;I just tried your code on SAS UE, using XLSX as the engine and it worked perfectly. However, I did notice (in one of your previous responses) that your log doesn't match your submitted code. &amp;nbsp;Why does the log show that macro variable var2 resolved to something, but you specified &amp;amp;var1 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335353#M272333</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-23T17:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Range of using Proc Import xlsx format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335362#M272334</link>
      <description>&lt;P&gt;Now It worked properly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you both!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The import data set has 25 observations and 7 variables.
NOTE: WORK.BAL_M00_ACCT_BAL_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      


NOTE: The import data set has 25 observations and 7 variables.
NOTE: WORK.CR_M00_ACCT_CR_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
      


NOTE: The import data set has 25 observations and 7 variables.
NOTE: WORK.PYM1_M00_ACT_PYM_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      


NOTE: The import data set has 25 observations and 7 variables.
NOTE: WORK.PYM2_M00_ACCT_P_AM data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Range-of-using-Proc-Import-xlsx-format/m-p/335362#M272334</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-02-23T17:36:00Z</dc:date>
    </item>
  </channel>
</rss>

