<?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: odd behavior for a string parameter in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65590#M6582</link>
    <description>Cynthia&lt;BR /&gt;
Thank you so much.&lt;BR /&gt;
The %unquote function worked perfectly.&lt;BR /&gt;
&lt;BR /&gt;
One more thing if I make the parameter X an integer I don't have this problem.  In the future I'll use %unquote on my string parameters.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again.</description>
    <pubDate>Thu, 19 Aug 2010 19:58:33 GMT</pubDate>
    <dc:creator>darrylovia</dc:creator>
    <dc:date>2010-08-19T19:58:33Z</dc:date>
    <item>
      <title>odd behavior for a string parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65588#M6580</link>
      <description>I discovered that by creating a string parameter in the Parameters (Macro Variables) Manager.  SAS Enterprise Guide (4.1.0.471) wraps the value with unreadable characters © and ®  respectively.  Does any one else have this problem.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
CODE:&lt;BR /&gt;
** in the Parameter Manager make a parameter named X;&lt;BR /&gt;
** set it to a string;&lt;BR /&gt;
** add parameter in code module;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
options symbolgen merror mologic;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  create table shoes_&amp;amp;x as&lt;BR /&gt;
  select *&lt;BR /&gt;
  from sashelp.shoes&lt;BR /&gt;
  where stores=&amp;amp;x;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select *&lt;BR /&gt;
  from dictionary.macros;&lt;BR /&gt;
&lt;BR /&gt;
** GLOBAL X 0 ©12® ;&lt;BR /&gt;
** the macro var x resolves with unreadable characters;&lt;BR /&gt;
&lt;BR /&gt;
LOG:&lt;BR /&gt;
1          ;*';*";*/;quit;run;&lt;BR /&gt;
2          OPTIONS PAGENO=MIN;&lt;BR /&gt;
3          %LET _CLIENTTASKLABEL=%NRBQUOTE(Code);&lt;BR /&gt;
4          %LET _EGTASKLABEL=%NRBQUOTE(Code);&lt;BR /&gt;
5          %LET _CLIENTPROJECTNAME=%NRBQUOTE();&lt;BR /&gt;
6          %LET _SASPROGRAMFILE=;&lt;BR /&gt;
7          %LET x = %NRSTR(12);&lt;BR /&gt;
8          &lt;BR /&gt;
9          ODS _ALL_ CLOSE;&lt;BR /&gt;
NOTE: Some of your options or statements may not be supported with the Activex or Java series &lt;BR /&gt;
      of devices.  Graph defaults for these drivers may be different from other SAS/GRAPH &lt;BR /&gt;
      device drivers.  For further information, please contact Technical Support.&lt;BR /&gt;
10         OPTIONS DEV=ACTIVEX;&lt;BR /&gt;
SYMBOLGEN:  Macro variable SASWORKLOCATION resolves to "C:\DOCUME~1\ddputnam\LOCALS~1\Temp\SAS &lt;BR /&gt;
            Temporary Files\_TD1368\Prc2/"&lt;BR /&gt;
11         FILENAME EGHTML TEMP;&lt;BR /&gt;
NOTE: Writing HTML(EGHTML) Body file: EGHTML&lt;BR /&gt;
12         ODS HTML(ID=EGHTML) FILE=EGHTML ENCODING='utf-8' STYLE=EGDefault&lt;BR /&gt;
12       ! STYLESHEET=(URL="file:///C:/engapps/SAS/Shared%20Files/BIClientStyles/EGDefault.css")&lt;BR /&gt;
12       !  ATTRIBUTES=("CODEBASE"="http://www2.sas.com/codebase/graph/v91/sasgraph.exe")&lt;BR /&gt;
12       ! NOGTITLE NOGFOOTNOTE GPATH=&amp;amp;sasworklocation;&lt;BR /&gt;
SYMBOLGEN:  Macro variable SYSVLONG resolves to 9.01.01M3P020206&lt;BR /&gt;
SYMBOLGEN:  Macro variable GRAPHAVAIL resolves to 9.01 TS1M3&lt;BR /&gt;
13         &lt;BR /&gt;
14         %gaccessible;&lt;BR /&gt;
SYMBOLGEN:  Macro variable ACCESSIBLE resolves to ACCESSIBLE&lt;BR /&gt;
15         ** in the Parameter Manager make a parameter named X;&lt;BR /&gt;
16         ** set it to a string;&lt;BR /&gt;
17         ** add parameter in code module;&lt;BR /&gt;
18         ** GLOBAL X 0 ©12® ;&lt;BR /&gt;
19         &lt;BR /&gt;
ERROR 13-12: Unrecognized SAS option name, MOLOGIC.&lt;BR /&gt;
20         options symbolgen merror mologic;&lt;BR /&gt;
                                    _______&lt;BR /&gt;
                                    13&lt;BR /&gt;
&lt;BR /&gt;
21         proc sql;&lt;BR /&gt;
22           create table shoes_&amp;amp;x as&lt;BR /&gt;
SYMBOLGEN:  Macro variable X resolves to 12&lt;BR /&gt;
SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been &lt;BR /&gt;
            unquoted for printing.&lt;BR /&gt;
22           create table shoes_&amp;amp;x as&lt;BR /&gt;
                                   __&lt;BR /&gt;
                                   202&lt;BR /&gt;
ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the macro variable "X".&lt;BR /&gt;
22          shoes_12&lt;BR /&gt;
                  __&lt;BR /&gt;
                  22&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: (, '.', AS, LIKE.  &lt;BR /&gt;
&lt;BR /&gt;
2                                        The SAS System          13:58 Thursday, August 19, 2010&lt;BR /&gt;
&lt;BR /&gt;
23           select *&lt;BR /&gt;
24           from sashelp.shoes&lt;BR /&gt;
25           where stores=&amp;amp;x;&lt;BR /&gt;
SYMBOLGEN:  Macro variable X resolves to 12&lt;BR /&gt;
SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been &lt;BR /&gt;
            unquoted for printing.&lt;BR /&gt;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;
26         &lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
27         proc sql;&lt;BR /&gt;
28           select *&lt;BR /&gt;
29           from dictionary.macros;&lt;BR /&gt;
30         &lt;BR /&gt;
31         &lt;BR /&gt;
32         %LET _CLIENTTASKLABEL=;&lt;BR /&gt;
33         %LET _EGTASKLABEL=;&lt;BR /&gt;
34         %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;
35         %LET _SASPROGRAMFILE=;&lt;BR /&gt;
36         &lt;BR /&gt;
37         ;*';*";*/;quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.03 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
37       !                run;&lt;BR /&gt;
38         ODS _ALL_ CLOSE;&lt;BR /&gt;
39         &lt;BR /&gt;
40         &lt;BR /&gt;
41         QUIT; RUN;&lt;BR /&gt;
42</description>
      <pubDate>Thu, 19 Aug 2010 18:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65588#M6580</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2010-08-19T18:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: odd behavior for a string parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65589#M6581</link>
      <description>Hi:&lt;BR /&gt;
  In most cases, those "unprintable" characters are removed appropriately, as needed in the code and you can see evidence of this in the SYMBOLGEN message:&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
If you look in the documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/a001061351.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#/documentation/cdl/en/mcrolref/61885/HTML/default/a001061351.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
You will discover that some macro values are protected with a "delta" character. The above page says:&lt;BR /&gt;
&lt;B&gt;beginquote&lt;BR /&gt;
&lt;I&gt;&lt;BR /&gt;
When the macro processor masks a text string, it masks special characters and mnemonics within the coding scheme, and prefixes and suffixes the string with a hexadecimal character, called a delta character. The prefix character marks the beginning of the string and also indicates what type of macro quoting is to be applied to the string. The suffix character marks the end of the string. The prefix and suffix characters preserve any leading and trailing blanks contained by the string. The hexadecimal characters used to mask special characters and mnemonics and the characters used for the prefix and suffix might vary and are not portable.&lt;BR /&gt;
               &lt;BR /&gt;
There are more hexadecimal combinations possible in each byte than are needed to represent the symbols on a keyboard. Therefore, when a macro quoting function recognizes an item to be masked, the macro processor uses a previously unused hexadecimal combination for the prefix and suffix characters.&lt;BR /&gt;
&lt;/I&gt;endquote&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
And about THIS error mesage,&lt;BR /&gt;
 ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
It is saying that there's something about &lt;BR /&gt;
&lt;B&gt;shoes_&amp;amp;x&lt;/B&gt; that it doesn't like (and you're right, it doesn't like those delta characters) But it is easy to get rid of them. Sometimes, you have to remove the special characters yourself.&lt;BR /&gt;
&lt;BR /&gt;
You will find that exact error message (202-322) in this Tech Support note, AND the note shows how to use the %UNQUOTE function to properly remove the special characters:&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/17/444.html" target="_blank"&gt;http://support.sas.com/kb/17/444.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Although the note talks mostly about user id and password and needing to unquote, it also shows how this example: &lt;BR /&gt;
data my_&amp;amp;testvar;&lt;BR /&gt;
 needs to turn into this: &lt;BR /&gt;
data my_%unquote(&amp;amp;testvar);&lt;BR /&gt;
&lt;BR /&gt;
And in your case, that would be the equivalent of having&lt;BR /&gt;
create table shoes_&amp;amp;x as &lt;BR /&gt;
turn into&lt;BR /&gt;
create table shoes_%unquote(&amp;amp;x) as&lt;BR /&gt;
 &lt;BR /&gt;
Hope this helps!&lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 19 Aug 2010 19:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65589#M6581</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-08-19T19:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: odd behavior for a string parameter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65590#M6582</link>
      <description>Cynthia&lt;BR /&gt;
Thank you so much.&lt;BR /&gt;
The %unquote function worked perfectly.&lt;BR /&gt;
&lt;BR /&gt;
One more thing if I make the parameter X an integer I don't have this problem.  In the future I'll use %unquote on my string parameters.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again.</description>
      <pubDate>Thu, 19 Aug 2010 19:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/odd-behavior-for-a-string-parameter/m-p/65590#M6582</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2010-08-19T19:58:33Z</dc:date>
    </item>
  </channel>
</rss>

