<?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 ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837824#M331292</link>
    <description>&lt;P&gt;i am trying to extract the below data in Excel using the proc export and i receive the below error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the dataset below has a variable with the name "." and this is what i believe causes the issue.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However, when i try to rename it using the rename below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data temp_1; 
set vol_partenon_product;
rename .=miss;
run;&lt;/PRE&gt;
&lt;P&gt;i also get an error below is the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;27         data temp_1;
28         set vol_partenon_product;
29         rename .=miss;
                  _
                  22
                  200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;.  

ERROR 200-322: The symbol is not recognized and will be ignored.

30         run;&lt;/PRE&gt;
&lt;P&gt;this is the data which i am trying to export to an Excel:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month	300	.
Dec2017	102260.0000000000	0.0000000000
Mar2018	100254.0000000000	0.0000000000
Jun2018	102456.0000000000	0.0000000000
Sep2018	101129.0000000000	0.0000000000

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there any way to rename the "." variable ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 11:54:44 GMT</pubDate>
    <dc:creator>Toni2</dc:creator>
    <dc:date>2022-10-11T11:54:44Z</dc:date>
    <item>
      <title>ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837824#M331292</link>
      <description>&lt;P&gt;i am trying to extract the below data in Excel using the proc export and i receive the below error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the dataset below has a variable with the name "." and this is what i believe causes the issue.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However, when i try to rename it using the rename below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data temp_1; 
set vol_partenon_product;
rename .=miss;
run;&lt;/PRE&gt;
&lt;P&gt;i also get an error below is the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;27         data temp_1;
28         set vol_partenon_product;
29         rename .=miss;
                  _
                  22
                  200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;.  

ERROR 200-322: The symbol is not recognized and will be ignored.

30         run;&lt;/PRE&gt;
&lt;P&gt;this is the data which i am trying to export to an Excel:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month	300	.
Dec2017	102260.0000000000	0.0000000000
Mar2018	100254.0000000000	0.0000000000
Jun2018	102456.0000000000	0.0000000000
Sep2018	101129.0000000000	0.0000000000

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there any way to rename the "." variable ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837824#M331292</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-10-11T11:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837848#M331301</link>
      <description>&lt;P&gt;You have a variable named 300 and another variable name that is just a single period?&lt;/P&gt;
&lt;P&gt;Why? How did you make such a thing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to create an Excel file (EXPORT) or read from an existing Excel file (IMPORT)?&lt;/P&gt;
&lt;P&gt;If you are exporting then run PROC CONTENTS on the existing SAS dataset.&lt;/P&gt;
&lt;P&gt;If you are importing then show the SAS code you used to try to import the XLSX file.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837848#M331301</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-11T13:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837850#M331303</link>
      <description>&lt;P&gt;the names of variables indicate groups. I split observations in different groups and then the groups are used as names. The "." indicates the group of missing. This has been created previously in another macro in previous steps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to export data in Excel using the proc export function.&amp;nbsp;Below is the proc contents of the data i am trying to export (apologies for the format)&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;Alphabetic List of Variables and Attributes				
#	Variable	Type	Len	Format
2	300	Num	8	30.1
3	.	Num	8	30.1
1	month	Num	8	MONYY.
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Variable "." is numeric&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837850#M331303</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-10-11T13:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837860#M331307</link>
      <description>&lt;P&gt;Show the code you ran to "export" to Excel.&lt;/P&gt;
&lt;P&gt;It works fine for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;
data have;
  input month $ '300'n '.'n ;
cards;
Dec2017 102260.0000000000 0.0000000000
Mar2018 100254.0000000000 0.0000000000
Jun2018 102456.0000000000 0.0000000000
Sep2018 101129.0000000000 0.0000000000
;

ods excel file='c:\downloads\testing.xlsx';
proc print data=have noobs;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1665496619170.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76084iFD9BF61EEFA95E7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1665496619170.png" alt="Tom_0-1665496619170.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: You should keep not really be using those column headers as variable names.&amp;nbsp; It will be much easier if you keep the data in a more normalized form and just produce that REPORT from the actual data.&lt;/P&gt;
&lt;P&gt;This also has the benefit of letting you use VALIDVARNAME=V7 and prevent the creation of variables with goofy names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7;
data have;
  input month $ @ ;
  do name = '300','.' ;
    input value @;
    output;
  end;
  input;
cards;
Dec2017 102260.0000000000 0.0000000000
Mar2018 100254.0000000000 0.0000000000
Jun2018 102456.0000000000 0.0000000000
Sep2018 101129.0000000000 0.0000000000
;

ods excel file='c:\downloads\testing.xlsx';
proc report data=have ;
  column month value,name;
  define month/group;
  define value / ' ';
  define name / across ' ' order=data;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1665497095788.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76085i7EE54568883E5F8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_1-1665497095788.png" alt="Tom_1-1665497095788.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837860#M331307</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-11T14:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837863#M331309</link>
      <description>&lt;P&gt;hi thanks again. Here is the macro with the code to export in Excel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where :&lt;/P&gt;
&lt;P&gt;ds= dataset to extract&lt;/P&gt;
&lt;P&gt;extr_location= the path location for the file&lt;/P&gt;
&lt;P&gt;file_name=the name of the file&lt;/P&gt;
&lt;P&gt;lwin=my passwort&lt;/P&gt;
&lt;P&gt;pwin=my password&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro export_macro(extr_location=,ds=,file_name=,sheet_name=);

data _null_;
	call symput('today',compress(put(today(),ddmmyy6.)));
run;

/*options nomprint nomlogic nosymbolgen;*/
proc export dbms=excelcs data=&amp;amp;ds.
       	outfile="&amp;amp;extr_location.\&amp;amp;file_name._&amp;amp;today..xls";
       	sheet="&amp;amp;sheet_name";
       	version="2002";                     
		server		= "corporate_server";
		port		= 9000;
		ServerUser = "copr\&amp;amp;lwin";
	    ServerPass = "&amp;amp;pwin";                          
RUN;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837863#M331309</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-10-11T14:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837864#M331310</link>
      <description>&lt;P&gt;Looks like you are trying to use SAS PC FILES server to allow you to write to a file on a computer other than the one where SAS is running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to rename those variables with the goofy names you need to use name literals, like in the code in my previous post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  rename '.'n = missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837864#M331310</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-11T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: During insert: [Microsoft][ODBC Excel Driver] Invalid bracketing of name '`.`'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837866#M331311</link>
      <description>thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-During-insert-Microsoft-ODBC-Excel-Driver-Invalid/m-p/837866#M331311</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-10-11T14:43:21Z</dc:date>
    </item>
  </channel>
</rss>

