<?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: ERROR: The value 'String'n is not a valid SAS name. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369810#M88333</link>
    <description>&lt;P&gt;You would need to at minimum show the code you are running. &amp;nbsp;The part:&lt;/P&gt;
&lt;P&gt;'....'n&lt;/P&gt;
&lt;P&gt;Refers to a named literal. &amp;nbsp;It is often used when gettting data from something which doesn't conform to SAS standards, Excel for instance is notorious for it. &amp;nbsp;You can name ranges or sheets anything, and 'XYZ &amp;nbsp;something' is not a valid SAS name, so you use the named literal structure to refer to it. &amp;nbsp;This would seem to be what is happening here, when SAS tries to read the data from Excel it is finding ranges or sheet names it can't deal with, so is putting them into named literals, though as I can't see your code I can't see what you are doing with them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So post your code for some suggestions, or a far, far better idea is to drop the data from Excel into a useable format, CSV for instance can be saved from Excel, then you can write a proper datastep import routine to read teh data correctly - avoids all the Excel nonsense.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 10:27:25 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-06-23T10:27:25Z</dc:date>
    <item>
      <title>ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369804#M88331</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I am creating a variable using proc sql :into statement from Table . Table having String in Chinese language , I am able to create variable but whenever I am try to insert this variable in a other table ( by proc sql &amp;amp; data step ) or want to print on log using %put then below Error is coming&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The value '，高於上季的上升'n is not a valid SAS name.&lt;/P&gt;&lt;P&gt;WARNING: Apparent invocation of macro ，高於上季的上升 not resolved.&lt;/P&gt;&lt;P&gt;ERROR: The value '，與上季相同'n is not a valid SAS name.&lt;/P&gt;&lt;P&gt;WARNING: Apparent invocation of macro ，與上季相同 not resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note :- I am not able to see “ &lt;STRONG&gt;‘ &lt;/STRONG&gt;“ &amp;nbsp;and “ &lt;STRONG&gt;‘n&lt;/STRONG&gt; “ value in table but it showing in log Error.&lt;/P&gt;&lt;P&gt;I have upload this data from Source file (.xlsx) using UTF-8 session (on SAS EG &amp;amp; SAS AC) and running my current code under UTF-8 session only. Below is the some part of that string&lt;/P&gt;&lt;P&gt;高於上季的上升 1.9% 與上月相同 (-) 澳洲&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to insert data in other table but above Error coming. I want to stop this error message&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 10:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369804#M88331</guid>
      <dc:creator>anandsasbi</dc:creator>
      <dc:date>2017-06-23T10:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369810#M88333</link>
      <description>&lt;P&gt;You would need to at minimum show the code you are running. &amp;nbsp;The part:&lt;/P&gt;
&lt;P&gt;'....'n&lt;/P&gt;
&lt;P&gt;Refers to a named literal. &amp;nbsp;It is often used when gettting data from something which doesn't conform to SAS standards, Excel for instance is notorious for it. &amp;nbsp;You can name ranges or sheets anything, and 'XYZ &amp;nbsp;something' is not a valid SAS name, so you use the named literal structure to refer to it. &amp;nbsp;This would seem to be what is happening here, when SAS tries to read the data from Excel it is finding ranges or sheet names it can't deal with, so is putting them into named literals, though as I can't see your code I can't see what you are doing with them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So post your code for some suggestions, or a far, far better idea is to drop the data from Excel into a useable format, CSV for instance can be saved from Excel, then you can write a proper datastep import routine to read teh data correctly - avoids all the Excel nonsense.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 10:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369810#M88333</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-23T10:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369813#M88336</link>
      <description>&lt;P&gt;You put data that contains a percent sign into a macro variable. When you use the value from that macro variable without masking the percent sign, the macro processor will kick in unexpectedly. Please show how you use that macro variable, from the proc sql with the into: to the step that causes the error message.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 10:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369813#M88336</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-23T10:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369823#M88338</link>
      <description>&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source team has provide us .xlsx file and this .xlsx file having multiple graph whit header &amp;amp; footer for each graph. I am reading header &amp;amp; footer data which available in fixed cell Position. If I will convert it into CSV file than graph and Cell position will be lost. But In .xlsx file and SAS table (like WORK.Test2) I am not able to see “&lt;STRONG&gt;’&lt;/STRONG&gt;” &amp;amp; “&lt;STRONG&gt;’n&lt;/STRONG&gt;” &amp;nbsp;. it’s coming only in log Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Below code i am using under UTF-8 Session.&lt;/P&gt;&lt;P&gt;%LET SHEETNAME = "10 sec pitch Staff";&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; IMPORT OUT= WORK.Test2 (keep=B D F R T V X ) DATAFILE= "/UnixPath/Source/external_Trad_Chinese_value_sample.xlsx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=XLSx REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SHEET=&amp;amp;SHEETNAME.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; sql;&lt;/P&gt;&lt;P&gt;create table Test2_Obs as&lt;/P&gt;&lt;P&gt;select monotonic() as obs,B , D , F, R ,T ,V , X from WORK.Test2;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select b into: AUD_Header from Test2_Obs where obs=12;&lt;/P&gt;&lt;P&gt;select tranwrd(b, "(~)", " ") as b1 length=400 into: AUD_Footr&lt;/P&gt;&lt;P&gt;from Test2_Obs where obs=14;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; sql;&lt;/P&gt;&lt;P&gt;create table FX_Market_T&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; header Char(400),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Footer char(400)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; sql;&lt;/P&gt;&lt;P&gt;/* In Insert Statement Error is coming */&lt;/P&gt;&lt;P&gt;insert into work.FX_Market_T&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values(“AUD_Header","&amp;amp;AUD_Footr")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;for below string I am getting ' &amp;amp; 'n error but in string it's not showing . In Particulr Cell having 4 lines&lt;/P&gt;&lt;P&gt;高於上季的上升 1.9% 與上月相同 (-) 澳洲&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please find Screeshot of Souce Cell from .xlsx file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13975i35C0DD62E3C30650/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="4Line in Fix Cell position.png" title="4Line in Fix Cell position.png" /&gt;</description>
      <pubDate>Fri, 23 Jun 2017 11:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369823#M88338</guid>
      <dc:creator>anandsasbi</dc:creator>
      <dc:date>2017-06-23T11:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369830#M88341</link>
      <description>&lt;P&gt;If the whole purpose of this overcomplicated code is the creation of a dataset with one obs containing header and footer text, consider this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fx_market_t (keep=header footer);
retain header footer;
length header footer $400;
set test2 end=done;
if _n_ = 12 then header = b;
if _n_ = 14 then footer = b;
if done then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the string with the percent sign never appears in program code (something that invariably happens when you use macro variables), you do not have the masking problem.&lt;/P&gt;
&lt;P&gt;As a reference for your problem, see this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input string $30.;
cards;
%thés is some data
;
run;

proc sql noprint;
select string into :macvar from test;
create table new (newstring char(30));
insert into new values("&amp;amp;macvar");
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which causes the same ERROR and WARNING&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 11:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/369830#M88341</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-23T11:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The value 'String'n is not a valid SAS name.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/370431#M88453</link>
      <description>&lt;P&gt;Hi &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_blank"&gt;KurtBremser&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your suggestion, Now I have change my code based on you suggestion ( exclude OBS and use Data step for Pick value from Table fix position ) . Now I am not getting any error.&lt;/P&gt;&lt;P&gt;Thanks Again J&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; AUH (Keep = Currency Currency_Type SpotLevel VS_HKD Daily_Change header Footer );&lt;/P&gt;&lt;P&gt;retain Currency Currency_Type SpotLevel VS_HKD Daily_Change header Footer ;&lt;/P&gt;&lt;P&gt;length Currency $4. Currency_Type $8. SpotLevel 8. VS_HKD 8. Daily_Change 8. header $400. Footer $400. ;&lt;/P&gt;&lt;P&gt;format&amp;nbsp;&amp;nbsp; SpotLevel 10.4 VS_HKD 10.4 Daily_Change 8.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set test2 end=done;&lt;/P&gt;&lt;P&gt;if _n_ = 9 then do; Currency_Type = b ; SpotLevel= input(Strip(f),8.); end;&lt;/P&gt;&lt;P&gt;if _n_ = 10 then do; Currency = SUBSTR(Strip(b),1,3) ; VS_HKD = input(Strip(f),8.) ; end;&lt;/P&gt;&lt;P&gt;if _n_ = 11 then Daily_Change = Input(strip(Substr(f, 1 , length(f)-1)),8.);&lt;/P&gt;&lt;P&gt;if _n_ = 12 then header = b;&lt;/P&gt;&lt;P&gt;if _n_ = 14 then footer = b;&lt;/P&gt;&lt;P&gt;if done then output;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 05:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-value-String-n-is-not-a-valid-SAS-name/m-p/370431#M88453</guid>
      <dc:creator>anandsasbi</dc:creator>
      <dc:date>2017-06-26T05:46:49Z</dc:date>
    </item>
  </channel>
</rss>

