<?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 LIBNAME XLSX Options on SAS Grid in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/328789#M271749</link>
    <description>&lt;P&gt;On SAS Grid, LIBNAME EXCEL doesn't work, so I'm stuck using LIBNAME XSLX. &amp;nbsp;There's one page on the SAS site that says that the XLSX engine has limited data set options as opposed to the EXCEL engine. &amp;nbsp;I've inherited a program that uses the data set options DBSASTYPE to set a group of variables later defined in array as numeric and DBSASLABEL=none. &amp;nbsp;I've tried using DBTYPE, and that also doesn't work. &amp;nbsp;The error is 'Invalid option'. &amp;nbsp;I can't find documentation ANYWHERE for the XLSX engine's available DATA step options, and I'd like to keep the program as close to the original, because it's quite elegant and is called by another program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a workaround besides manually redoing everything? &amp;nbsp;I've considered swapping the code for PROC SQL, but not 100% sure how I'd incorporate the code below. &amp;nbsp;I don't want to do it variable by variable because I call this macro multiple times for sheets with different 'NEW_' variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname edited XLSX "&amp;amp;file";&lt;/P&gt;&lt;P&gt;*Get names of new variables;&lt;BR /&gt;*Assuming new variables are named new_&amp;lt;oldvarname&amp;gt; in excel;&lt;BR /&gt;proc contents data=edited."&amp;amp;sheet."n out=varnames(keep=name) noprint; run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;length newvars oldvars $ 5000;&lt;BR /&gt;set varnames end=last;&lt;BR /&gt;retain newvars oldvars;&lt;/P&gt;&lt;P&gt;if upcase(scan(name,1,'_'))='NEW' then do;&lt;BR /&gt;oldvars=catx(' ',oldvars,scan(name,2,'_'));&lt;BR /&gt;newvars=catx(' ',newvars,name);&lt;BR /&gt;end;&lt;BR /&gt;if last then do;&lt;BR /&gt;call symput('NewVars',trim(newvars));&lt;BR /&gt;call symput('OldVars',trim(oldvars));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=edited."&amp;amp;sheet."n(keep=id questid rostnumb new_: dbsaslabel=none &amp;nbsp;dbsastype=(id='CHAR(11)' questid='CHAR(7)' *These options don't work.;&lt;BR /&gt;%LET index = 1;&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%DO %WHILE ("&amp;amp;newVar." ~= "");&lt;BR /&gt;&amp;amp;newVar.='NUMERIC'&lt;BR /&gt;%LET index = %EVAL(&amp;amp;index. + 1);&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%END;&lt;BR /&gt;))&lt;BR /&gt;out=chgs; BY &amp;amp;sort.;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2017 15:57:49 GMT</pubDate>
    <dc:creator>gewing</dc:creator>
    <dc:date>2017-01-31T15:57:49Z</dc:date>
    <item>
      <title>LIBNAME XLSX Options on SAS Grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/328789#M271749</link>
      <description>&lt;P&gt;On SAS Grid, LIBNAME EXCEL doesn't work, so I'm stuck using LIBNAME XSLX. &amp;nbsp;There's one page on the SAS site that says that the XLSX engine has limited data set options as opposed to the EXCEL engine. &amp;nbsp;I've inherited a program that uses the data set options DBSASTYPE to set a group of variables later defined in array as numeric and DBSASLABEL=none. &amp;nbsp;I've tried using DBTYPE, and that also doesn't work. &amp;nbsp;The error is 'Invalid option'. &amp;nbsp;I can't find documentation ANYWHERE for the XLSX engine's available DATA step options, and I'd like to keep the program as close to the original, because it's quite elegant and is called by another program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a workaround besides manually redoing everything? &amp;nbsp;I've considered swapping the code for PROC SQL, but not 100% sure how I'd incorporate the code below. &amp;nbsp;I don't want to do it variable by variable because I call this macro multiple times for sheets with different 'NEW_' variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname edited XLSX "&amp;amp;file";&lt;/P&gt;&lt;P&gt;*Get names of new variables;&lt;BR /&gt;*Assuming new variables are named new_&amp;lt;oldvarname&amp;gt; in excel;&lt;BR /&gt;proc contents data=edited."&amp;amp;sheet."n out=varnames(keep=name) noprint; run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;length newvars oldvars $ 5000;&lt;BR /&gt;set varnames end=last;&lt;BR /&gt;retain newvars oldvars;&lt;/P&gt;&lt;P&gt;if upcase(scan(name,1,'_'))='NEW' then do;&lt;BR /&gt;oldvars=catx(' ',oldvars,scan(name,2,'_'));&lt;BR /&gt;newvars=catx(' ',newvars,name);&lt;BR /&gt;end;&lt;BR /&gt;if last then do;&lt;BR /&gt;call symput('NewVars',trim(newvars));&lt;BR /&gt;call symput('OldVars',trim(oldvars));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=edited."&amp;amp;sheet."n(keep=id questid rostnumb new_: dbsaslabel=none &amp;nbsp;dbsastype=(id='CHAR(11)' questid='CHAR(7)' *These options don't work.;&lt;BR /&gt;%LET index = 1;&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%DO %WHILE ("&amp;amp;newVar." ~= "");&lt;BR /&gt;&amp;amp;newVar.='NUMERIC'&lt;BR /&gt;%LET index = %EVAL(&amp;amp;index. + 1);&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%END;&lt;BR /&gt;))&lt;BR /&gt;out=chgs; BY &amp;amp;sort.;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 15:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/328789#M271749</guid>
      <dc:creator>gewing</dc:creator>
      <dc:date>2017-01-31T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME XLSX Options on SAS Grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/450719#M271750</link>
      <description>&lt;P&gt;Can you provide an example spreadsheet?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/450719#M271750</guid>
      <dc:creator>dgritt</dc:creator>
      <dc:date>2018-04-03T15:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME XLSX Options on SAS Grid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/450938#M271751</link>
      <description>&lt;P&gt;Not too sure about the libname, but for sql you could do:&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;create table CHGS as&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;select ID length=11 &lt;SPAN&gt;&amp;nbsp;label=' '&lt;/SPAN&gt;, QUESTID length=7 label=' '&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%LET index = 1;&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%DO %WHILE ("&amp;amp;newVar." ~= "");&lt;BR /&gt;&amp;nbsp; ,&amp;amp;newVar. &amp;nbsp;label=' '&lt;BR /&gt;%LET index = %EVAL(&amp;amp;index. + 1);&lt;BR /&gt;%LET newVar = %SCAN(&amp;amp;newVars., &amp;amp;index.);&lt;BR /&gt;%END;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;from&amp;nbsp;edited."&amp;amp;sheet."n&lt;BR /&gt;order by &amp;amp;sort;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 04:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-XLSX-Options-on-SAS-Grid/m-p/450938#M271751</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-04T04:19:46Z</dc:date>
    </item>
  </channel>
</rss>

