<?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: Why is PROC SQL uppercasing from Excel? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570412#M75243</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Since I want to take those values to feed into PROC IMPORT on SAS grid, I need the case of the variable to match the case of the Excel sheet. Is there a better way to do this that would maintain the capitalization that isn't the PROC SQL dictionary code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SAS on Grid is case sensitive to the sheet names? Usually it's not case sensitive at all, except for character values entirely. Will have to test it on on regular SAS to see if that's an&amp;nbsp;issue as well. &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 00:22:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-07-02T00:22:24Z</dc:date>
    <item>
      <title>Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570398#M75235</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro getNames (ssheet,sasds);
libname X xlsx "pathpathpath/archive/extracted/20190627/&amp;amp;ssheet";
proc sql noprint;
	create table sheets_&amp;amp;sasds. as 
		select memname 
			from dictionary.members
				where libname="X";
quit;

%mend;

data _null_;
	set download_file_usablelist;
	practice_prefix=substr(file_name,1,8);
	call execute('%getNames(ssheet='!!file_name!!',sasds='!!practice_prefix!!')');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi SAS friends!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on reading sheet names from 500+ Excel workbooks using PROC SQL. The code below works great, BUT the resulting observations in data sets 'sheets_&amp;amp;sasds.' are all automatically upcased. I'm using the SAS grid, so I need these to be in the case they were originally in, because I'm intending to turn these sheet names into a macro variable to be used in PROC IMPORT so I can pull the data from specific sheets in the workbooks. Any suggestions to make this stop the automatic capitalization?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Disclaimer: Full path not included here, replaced with 'pathpathpath'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 21:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570398#M75235</guid>
      <dc:creator>gewing</dc:creator>
      <dc:date>2019-07-01T21:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570399#M75236</link>
      <description>&lt;P&gt;Can you explain what you are talking about?&lt;/P&gt;
&lt;P&gt;If SAS is changing the values of cells in the Excel sheets please show an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or are you just talking about the LIBNAME or MEMNAME field from DICTIONARY.MEMBERS? That view always shows those names in uppercase.&amp;nbsp; If you don't want that then don't use that method to get the metadata.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 21:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570399#M75236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-01T21:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570400#M75237</link>
      <description>&lt;P&gt;Well, I was talking about the latter since that's what my code is doing... is there a way to maintain the original case of the sheet name?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 21:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570400#M75237</guid>
      <dc:creator>gewing</dc:creator>
      <dc:date>2019-07-01T21:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570401#M75238</link>
      <description>&lt;P&gt;What does PROC CONTENTS show you?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 21:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570401#M75238</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-01T21:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570402#M75239</link>
      <description>&lt;P&gt;The PROC CONTENTS output is moot. I'm trying to create datasets that correspond to each of the 500+ workbooks I have, that contain the names of all of the worksheets in the Excel workbook. The code I have does that, but I'm wondering if there's a way to maintain the original case. Since I want to take those values to feed into PROC IMPORT on SAS grid, I need the case of the variable to match the case of the Excel sheet. Is there a better way to do this that would maintain the capitalization that isn't the PROC SQL dictionary code?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 22:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570402#M75239</guid>
      <dc:creator>gewing</dc:creator>
      <dc:date>2019-07-01T22:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570403#M75240</link>
      <description>&lt;P&gt;Not sure why you think using DICTIONARY views are any better than using PROC CONTENTS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro getNames (ssheet,sasds);
libname X xlsx "pathpathpath/archive/extracted/20190627/&amp;amp;ssheet";
proc contents data=x._all_ noprint out=contents_&amp;amp;sasds; 
run;
proc sort data=contents_&amp;amp;sasds(keep=memname) nodupkey
  out=sheets_&amp;amp;sasds
;
run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 22:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570403#M75240</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-01T22:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570405#M75241</link>
      <description>&lt;P&gt;Mainly because I had no idea PROC CONTENTS could do that with Excel! Very cool. However when I run that, it also uppercases the MEMNAME like the DICTIONARY views, and there aren't any observations in the sheets_&amp;amp;sasds. datasets.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 22:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570405#M75241</guid>
      <dc:creator>gewing</dc:creator>
      <dc:date>2019-07-01T22:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570411#M75242</link>
      <description>&lt;P&gt;So then it looks like it is the XLSX engine that is upcasing the names it generates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can just read the list of sheets from the XML that makes up the XLSX file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filename="c:\downloads\testa.xlsx";
%let sheets=my_sheets;

*----------------------------------------------------------------------;
* Generate XMLMAP to read the sheetnames from xl/workbook.xml ;
*----------------------------------------------------------------------;
filename _wbmap temp;
data _null_;
  file _wbmap;
  put '&amp;lt;SXLEMAP version="2.1"&amp;gt;&amp;lt;TABLE name="Sheets"&amp;gt;'
    / '&amp;lt;TABLE-PATH&amp;gt;/workbook/sheets/sheet&amp;lt;/TABLE-PATH&amp;gt;'
    / '&amp;lt;COLUMN name="Sheet"&amp;gt;&amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;'
    / '&amp;lt;DESCRIPTION&amp;gt;Sheet Name&amp;lt;/DESCRIPTION&amp;gt;'
    / '&amp;lt;PATH&amp;gt;/workbook/sheets/sheet/@name&amp;lt;/PATH&amp;gt;'
    / '&amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;&amp;lt;LENGTH&amp;gt;32&amp;lt;/LENGTH&amp;gt;'
    / '&amp;lt;/COLUMN&amp;gt;'
    / '&amp;lt;COLUMN name="State"&amp;gt;&amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;'
    / '&amp;lt;DESCRIPTION&amp;gt;Sheet State&amp;lt;/DESCRIPTION&amp;gt;'
    / '&amp;lt;PATH&amp;gt;/workbook/sheets/sheet/@state&amp;lt;/PATH&amp;gt;'
    / '&amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;&amp;lt;LENGTH&amp;gt;20&amp;lt;/LENGTH&amp;gt;'
    / '&amp;lt;/COLUMN&amp;gt;'
    / '&amp;lt;/TABLE&amp;gt;&amp;lt;/SXLEMAP&amp;gt;'
  ;
run;

*----------------------------------------------------------------------;
* Copy xl/workbook.xml from XLSX file to physical file ;
* Note: Cannot use ZIP filename engine with XMLV2 libname engine ;
*----------------------------------------------------------------------;
filename _wbzip ZIP &amp;amp;filename member='xl/workbook.xml';
filename _wb temp ;
data _null_;
  infile _wbzip lrecl=30000;
  file _wb lrecl=30000;
  input;
  put _infile_;
run;

*----------------------------------------------------------------------;
* Generate LIBNAME pointing to copy of xl/workbook.xml from XLSX file ;
*----------------------------------------------------------------------;
libname _wb xmlv2 xmlmap=_wbmap ;

*----------------------------------------------------------------------;
* Read sheet names from XLSX file into a SAS dataset. ;
* Create valid SAS dataset name from sheetname or sheetnumber. ;
*----------------------------------------------------------------------;
filename extract temp;
data &amp;amp;sheets ;
  if eof then call symputx('nsheets',_n_-1);
  length Number 8;
  set _wb.sheets end=eof;
  number+1;
  length Memname $32 Filename $256 ;
  label number='Sheet Number' memname='Mapped SAS Memname' filename='Source Filename' ;
  filename = &amp;amp;filename ;
  if ^nvalid(compress(sheet),'v7') then memname = cats('Sheet',number);
  else memname = translate(trim(compbl(sheet)),'_',' ');
run;

proc print;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    Number    Sheet     State    Memname           Filename

 1        1      Sheet1             Sheet1     c:\downloads\testa.xlsx
 2        2      Sheet2             Sheet2     c:\downloads\testa.xlsx
 3        3      Sheet3             Sheet3     c:\downloads\testa.xlsx
&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jul 2019 00:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570411#M75242</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-02T00:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570412#M75243</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Since I want to take those values to feed into PROC IMPORT on SAS grid, I need the case of the variable to match the case of the Excel sheet. Is there a better way to do this that would maintain the capitalization that isn't the PROC SQL dictionary code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SAS on Grid is case sensitive to the sheet names? Usually it's not case sensitive at all, except for character values entirely. Will have to test it on on regular SAS to see if that's an&amp;nbsp;issue as well. &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 00:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570412#M75243</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-02T00:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570416#M75244</link>
      <description>&lt;P&gt;Right. On Unix the case of FILENAMEs is case sensitive.&lt;/P&gt;
&lt;P&gt;But within an XLSX sheet names are NOT case sensitive.&amp;nbsp; You cannot have one sheet named Sheet1 and a different sheet name SHEET1.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 01:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570416#M75244</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-02T01:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570571#M75245</link>
      <description>Yes, it will read in the upper case worksheet names, but if one needs to write out and you have picky end users it would be good to retain the case sensitivity.</description>
      <pubDate>Tue, 02 Jul 2019 14:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570571#M75245</guid>
      <dc:creator>Susan_M</dc:creator>
      <dc:date>2019-07-02T14:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570693#M75249</link>
      <description>&lt;P&gt;Try using the PRESERVE_TAB_NAMES option on the LIBNAME statement to keep the case as desired.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n1qsjn9a18pja2n1gdctb7mc1ik8.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n1qsjn9a18pja2n1gdctb7mc1ik8.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname X xlsx "pathpathpath/archive/extracted/20190627/&amp;amp;ssheet" preserve_tab_names=Yes;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/126469"&gt;@gewing&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro getNames (ssheet,sasds);
libname X xlsx "pathpathpath/archive/extracted/20190627/&amp;amp;ssheet";
proc sql noprint;
	create table sheets_&amp;amp;sasds. as 
		select memname 
			from dictionary.members
				where libname="X";
quit;

%mend;

data _null_;
	set download_file_usablelist;
	practice_prefix=substr(file_name,1,8);
	call execute('%getNames(ssheet='!!file_name!!',sasds='!!practice_prefix!!')');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi SAS friends!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on reading sheet names from 500+ Excel workbooks using PROC SQL. The code below works great, BUT the resulting observations in data sets 'sheets_&amp;amp;sasds.' are all automatically upcased. I'm using the SAS grid, so I need these to be in the case they were originally in, because I'm intending to turn these sheet names into a macro variable to be used in PROC IMPORT so I can pull the data from specific sheets in the workbooks. Any suggestions to make this stop the automatic capitalization?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Disclaimer: Full path not included here, replaced with 'pathpathpath'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 18:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570693#M75249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-02T18:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why is PROC SQL uppercasing from Excel?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570696#M75251</link>
      <description>Thanks!! preserve_tab_names=Yes does the trick!!</description>
      <pubDate>Tue, 02 Jul 2019 18:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-is-PROC-SQL-uppercasing-from-Excel/m-p/570696#M75251</guid>
      <dc:creator>Susan_M</dc:creator>
      <dc:date>2019-07-02T18:35:55Z</dc:date>
    </item>
  </channel>
</rss>

