<?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: Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is creat in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959557#M374365</link>
    <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking at this log!&amp;nbsp; I don't know how you got it to run with different tables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**************************************************;&lt;BR /&gt;* Step 1: Create Macro Variables *;&lt;BR /&gt;**************************************************;&lt;BR /&gt;%let Division=3;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select quote(strip(Name))&lt;BR /&gt;into :StateList SEPARATED BY ","&lt;BR /&gt;from sq.statepopulation&lt;BR /&gt;where Division = "&amp;amp;Division";&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;=Division;&lt;BR /&gt;%put &amp;amp;=StateList;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**************************************************;&lt;BR /&gt;* Step 2: Use Macro Variables *;&lt;BR /&gt;**************************************************;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table division&amp;amp;Division as&lt;BR /&gt;select *&lt;BR /&gt;from sq.customer&lt;BR /&gt;where State in (&amp;amp;StateList);&lt;BR /&gt;quit;&lt;BR /&gt;options nosymbolgen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG&amp;nbsp; Step 1&lt;/P&gt;&lt;P&gt;%let Division=3;&lt;BR /&gt;74&lt;BR /&gt;75 proc sql noprint;&lt;BR /&gt;76 select quote(strip(Name))&lt;BR /&gt;77 into :StateList SEPARATED BY ","&lt;BR /&gt;78 from sq.statepopulation&lt;BR /&gt;79 where Division = "&amp;amp;Division";&lt;BR /&gt;NOTE: Data file SQ.STATEPOPULATION.DATA is in a format that is native to another host, or the file&lt;BR /&gt;encoding does not match the session encoding. Cross Environment Data Access will be used, which&lt;BR /&gt;might require additional CPU resources and might reduce performance.&lt;BR /&gt;80 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;81 %put &amp;amp;=Division;&lt;BR /&gt;DIVISION=3&lt;BR /&gt;82 %put &amp;amp;=StateList;&lt;BR /&gt;STATELIST="IL","IN","MI","OH","WI"&lt;BR /&gt;83&lt;BR /&gt;84&lt;BR /&gt;85 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;97&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG&amp;nbsp; Step 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;78 where State in (&amp;amp;StateList);&lt;BR /&gt;SYMBOLGEN: Macro variable STATELIST resolves to "IL","IN","MI","OH","WI"&lt;BR /&gt;&lt;STRONG&gt;NOTE: Data file SQ.CUSTOMER.DATA is in a format that is native to another host, or the file encoding &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;does not match the session encoding. Cross Environment Data Access will be used, which might &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;require additional CPU resources and might reduce performance.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Some character data was lost during transcoding in the dataset SQ.CUSTOMER. Either the data &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;contains characters that are not representable in the new encoding or truncation occurred &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;during transcoding.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;79 quit;&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.12 seconds&lt;BR /&gt;cpu time 0.11 seconds&lt;BR /&gt;&lt;BR /&gt;80 options nosymbolgen;&lt;BR /&gt;81&lt;BR /&gt;82 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;94&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2025 00:59:11 GMT</pubDate>
    <dc:creator>hmlong25</dc:creator>
    <dc:date>2025-02-19T00:59:11Z</dc:date>
    <item>
      <title>Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is created</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959400#M374317</link>
      <description>&lt;P&gt;s106d02.sas Concatenating Values in Macro Variables.sas&lt;/P&gt;&lt;P&gt;Concatenating Values in Macro Variables *;&lt;BR /&gt;***********************************************************;&lt;BR /&gt;&lt;BR /&gt;* Demo *;&lt;BR /&gt;* 1) Open the s106d02.sas program in the demos folder *;&lt;BR /&gt;* and find the Demo section. Run the code in Step 1: *;&lt;BR /&gt;* Create Macro Variables. Examine the results and log *;&lt;BR /&gt;* to see the values of the newly created macro *;&lt;BR /&gt;* variables &amp;amp;Division and &amp;amp;StateList. *;&lt;BR /&gt;* 2) Discuss the query under Step 2: Use Macro *;&lt;BR /&gt;* Variables. The table being created will end with *;&lt;BR /&gt;* the value of the macro variable &amp;amp;Division. The *;&lt;BR /&gt;* customer table will attempt to be subset by a list *;&lt;BR /&gt;* of values from the &amp;amp;StateList macro variable. Run *;&lt;BR /&gt;* the query and examine the errors. *;&lt;BR /&gt;* Note: The name of the new table will end with the *;&lt;BR /&gt;* value of the macro variable. *;&lt;BR /&gt;* 3) Move back to Step 1. Add the QUOTE function around *;&lt;BR /&gt;* the Name column. Run the query and %PUT statements. *;&lt;BR /&gt;* Examine the results and log. *;&lt;BR /&gt;* 4) Add the STRIP function inside the QUOTE function. *;&lt;BR /&gt;* Run the query and %PUT statements. Examine the *;&lt;BR /&gt;* results and log. *;&lt;BR /&gt;* 5) Move to Step 2. Run the query. Examine the results *;&lt;BR /&gt;* and log. *;&lt;BR /&gt;* 6) Move to Step 1. Change the value in the %LET *;&lt;BR /&gt;* statement to 9 and add the NOPRINT option in the *;&lt;BR /&gt;* PROC SQL statement to finalize the program. Run the *;&lt;BR /&gt;* entire program. Examine the results and log. *;&lt;BR /&gt;***********************************************************;&lt;/P&gt;&lt;P&gt;**************************************************;&lt;BR /&gt;* Step 1: Create Macro Variables *;&lt;BR /&gt;**************************************************;&lt;BR /&gt;%let Division=3;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select quote(strip(Name))&lt;BR /&gt;into :StateList SEPARATED BY ","&lt;BR /&gt;from sq.statepopulation&lt;BR /&gt;where Division = "&amp;amp;Division";&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;=Division;&lt;BR /&gt;%put &amp;amp;=StateList;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;**************************************************;&lt;BR /&gt;* Step 2: Use Macro Variables *;&lt;BR /&gt;**************************************************;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table division&amp;amp;Division as&lt;BR /&gt;select *&lt;BR /&gt;from sq.customer&lt;BR /&gt;where State in (&amp;amp;StateList);&lt;BR /&gt;quit;&lt;BR /&gt;options nosymbolgen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 19:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959400#M374317</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-02-17T19:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is creat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959402#M374318</link>
      <description>&lt;P&gt;That sounds like the PURPOSE of the exercise.&amp;nbsp; Look at what it says to do in bullet point number (3).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not include the quotes in the macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let statelist=CT,MA,NY;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then try to use it to generate code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where state in (&amp;amp;statelist)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You get code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where state in (CT,MA,NY)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is invalid because written that way CT, MA and NY are variable names.&amp;nbsp; But the IN operator only wants constants in the list, not variable names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you add the QUOTE() function in the initial query then the generated WHERE condition will instead look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where state in ("CT","MA","NY")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is valid SAS syntax.&amp;nbsp; And it should work as long as STATE is a character variable in the dataset being queried.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 19:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959402#M374318</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-17T19:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is creat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959409#M374321</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I did add the quote formatting and that was not the error message I was referring to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Two different tables were cited in the Demo instructions by mistake.&amp;nbsp; SQ.Statepopulation in Step one and then SQ.Customer in Step 2.&amp;nbsp; when I changed the table in Step 2 to match Step 1 ( SQ.StatePopulation).... I did get&amp;nbsp; a table created in Step 2.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Step 1: Create Macro Variables *;&amp;nbsp;&lt;BR /&gt;**************************************************;&lt;BR /&gt;%let Division=3;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select quote(strip(Name))&lt;BR /&gt;into :StateList SEPARATED BY ","&lt;BR /&gt;from sq.statepopulation&lt;BR /&gt;where Division = "&amp;amp;Division";&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;=Division;&lt;BR /&gt;%put &amp;amp;=StateList;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;**************************************************;&lt;BR /&gt;* Step 2: Use Macro Variables *;&lt;BR /&gt;**************************************************;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table division&amp;amp;Division as&lt;BR /&gt;select *&lt;BR /&gt;from sq.customer&lt;BR /&gt;where State in (&amp;amp;StateList);&lt;BR /&gt;quit;&lt;BR /&gt;options nosymbolgen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 20:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959409#M374321</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-02-17T20:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is creat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959423#M374325</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm not sure why you're getting errors. I downloaded the zip file for the SQL 1 class, created the data files and first ran the s106d02.sas program (after making the required changes) as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1739841886549.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104694i157ACDDB5AA7BD8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1739841886549.png" alt="Cynthia_sas_0-1739841886549.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I changed the %LET for DIVISION to 9 and ran again.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1739841909747.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104695i74629BC6E2E6825B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1739841909747.png" alt="Cynthia_sas_1-1739841909747.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got both work.Division3 and work.Division9 created correctly from the sq.customer data file based on first creating the &amp;amp;StateList macro variable created from sq.statepopulation.&amp;nbsp; Hope this helps you figure out what happened. Seeing your entire log -- both steps starting with the %LET and showing all the %PUT output would be very useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 01:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959423#M374325</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-02-18T01:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Please check SAS 9.4 ADV s106d02.sas demo. Step 2 code had an error message    no table is creat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959557#M374365</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking at this log!&amp;nbsp; I don't know how you got it to run with different tables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**************************************************;&lt;BR /&gt;* Step 1: Create Macro Variables *;&lt;BR /&gt;**************************************************;&lt;BR /&gt;%let Division=3;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select quote(strip(Name))&lt;BR /&gt;into :StateList SEPARATED BY ","&lt;BR /&gt;from sq.statepopulation&lt;BR /&gt;where Division = "&amp;amp;Division";&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;=Division;&lt;BR /&gt;%put &amp;amp;=StateList;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**************************************************;&lt;BR /&gt;* Step 2: Use Macro Variables *;&lt;BR /&gt;**************************************************;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table division&amp;amp;Division as&lt;BR /&gt;select *&lt;BR /&gt;from sq.customer&lt;BR /&gt;where State in (&amp;amp;StateList);&lt;BR /&gt;quit;&lt;BR /&gt;options nosymbolgen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG&amp;nbsp; Step 1&lt;/P&gt;&lt;P&gt;%let Division=3;&lt;BR /&gt;74&lt;BR /&gt;75 proc sql noprint;&lt;BR /&gt;76 select quote(strip(Name))&lt;BR /&gt;77 into :StateList SEPARATED BY ","&lt;BR /&gt;78 from sq.statepopulation&lt;BR /&gt;79 where Division = "&amp;amp;Division";&lt;BR /&gt;NOTE: Data file SQ.STATEPOPULATION.DATA is in a format that is native to another host, or the file&lt;BR /&gt;encoding does not match the session encoding. Cross Environment Data Access will be used, which&lt;BR /&gt;might require additional CPU resources and might reduce performance.&lt;BR /&gt;80 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;81 %put &amp;amp;=Division;&lt;BR /&gt;DIVISION=3&lt;BR /&gt;82 %put &amp;amp;=StateList;&lt;BR /&gt;STATELIST="IL","IN","MI","OH","WI"&lt;BR /&gt;83&lt;BR /&gt;84&lt;BR /&gt;85 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;97&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG&amp;nbsp; Step 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;78 where State in (&amp;amp;StateList);&lt;BR /&gt;SYMBOLGEN: Macro variable STATELIST resolves to "IL","IN","MI","OH","WI"&lt;BR /&gt;&lt;STRONG&gt;NOTE: Data file SQ.CUSTOMER.DATA is in a format that is native to another host, or the file encoding &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;does not match the session encoding. Cross Environment Data Access will be used, which might &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;require additional CPU resources and might reduce performance.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Some character data was lost during transcoding in the dataset SQ.CUSTOMER. Either the data &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;contains characters that are not representable in the new encoding or truncation occurred &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;during transcoding.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;79 quit;&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.12 seconds&lt;BR /&gt;cpu time 0.11 seconds&lt;BR /&gt;&lt;BR /&gt;80 options nosymbolgen;&lt;BR /&gt;81&lt;BR /&gt;82 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;94&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 00:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-check-SAS-9-4-ADV-s106d02-sas-demo-Step-2-code-had-an/m-p/959557#M374365</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-02-19T00:59:11Z</dc:date>
    </item>
  </channel>
</rss>

