<?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: In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919288#M362102</link>
    <description>&lt;P&gt;You want to think &lt;STRONG&gt;real hard&lt;/STRONG&gt; about what this line is actually doing to your existing variable and what happens after:&lt;/P&gt;
&lt;PRE&gt;%let Split_values =  %scan(&amp;amp;split_values, &amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;Real hard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As in you just destroyed the list of values in &amp;amp;split_values.&lt;/P&gt;
&lt;P&gt;One strongly suspects that you meant to use to get one from the list&lt;/P&gt;
&lt;PRE&gt;%let Split_value =  %scan(&amp;amp;split_values, &amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you hadn't destroyed &amp;amp;split_values this would not work as likely intended as &amp;amp;split_value&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;s &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;is a space delimited list and gets a value like "gender_F M"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;data &amp;amp;out._&amp;amp;Split_values;&lt;/PRE&gt;
&lt;P&gt;Which brings up a question, is &amp;amp;out supposed to be a library or just a data set prefix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to consider using an iterated list instead of the do while:&lt;/P&gt;
&lt;PRE&gt;/* if you feel a need to count &amp;amp;sqlobs after the SQL, when it runs correctly, will have the count of items in the list*/*/&lt;BR /&gt;%do i= 1 %to &amp;amp;sysfunc(countw(&amp;amp;split_values));
%let Split_value = %scan(&amp;amp;split_values,&amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;NE and the macro language can be a bit touchy for some things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2024 11:53:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-03-07T11:53:50Z</dc:date>
    <item>
      <title>In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919269#M362098</link>
      <description>&lt;PRE&gt;options Mprint Mlogic Symbolgen &lt;BR /&gt;&lt;BR /&gt;%MACRO Testw (Dsn=, out=, Split_var=);&lt;BR /&gt;proc sql;&lt;BR /&gt;select distinct &amp;amp;Split_var into : Split_values separated by ' '&lt;BR /&gt;from &amp;amp;Dsn;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;%let i = 1;&lt;BR /&gt;%do %while(%scan (&amp;amp;Split_var, &amp;amp;i) ne );&lt;BR /&gt;%let Split_values =  %scan(&amp;amp;split_values, &amp;amp;i);&lt;BR /&gt;data &amp;amp;out._&amp;amp;Split_values;&lt;BR /&gt;set &amp;amp;Dsn&lt;BR /&gt;where &amp;amp;Split_var = = "&amp;amp;split_value";&lt;BR /&gt;run;&lt;BR /&gt;%let i = %eval(&amp;amp;i+1);&lt;BR /&gt;%end;&lt;BR /&gt;%put Splitting complete;&lt;BR /&gt;%mend;&lt;BR /&gt;%Testw(Dsn=sashelp.class, out=Gender, Split_var=sex);&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2024 10:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919269#M362098</guid>
      <dc:creator>nxmogil</dc:creator>
      <dc:date>2024-03-07T10:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919271#M362100</link>
      <description>&lt;P&gt;You are missing a semi-colon on one of your SAS statements. Please look carefully, I'm sure you will find it. (Actually you have at least two missing semi-colons, but only the first such omission is causing this error).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;By the way, splitting data sets this way is rarely a good thing to do, it simply makes programming whatever the next step much more difficult. And for some people, as you have found, getting the macro to work isn't that simple. Why are you writing a macro to split this data set? What will you do with the splits, what is the next step after running this macro?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 12:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919271#M362100</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-07T12:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919288#M362102</link>
      <description>&lt;P&gt;You want to think &lt;STRONG&gt;real hard&lt;/STRONG&gt; about what this line is actually doing to your existing variable and what happens after:&lt;/P&gt;
&lt;PRE&gt;%let Split_values =  %scan(&amp;amp;split_values, &amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;Real hard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As in you just destroyed the list of values in &amp;amp;split_values.&lt;/P&gt;
&lt;P&gt;One strongly suspects that you meant to use to get one from the list&lt;/P&gt;
&lt;PRE&gt;%let Split_value =  %scan(&amp;amp;split_values, &amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you hadn't destroyed &amp;amp;split_values this would not work as likely intended as &amp;amp;split_value&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;s &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;is a space delimited list and gets a value like "gender_F M"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;data &amp;amp;out._&amp;amp;Split_values;&lt;/PRE&gt;
&lt;P&gt;Which brings up a question, is &amp;amp;out supposed to be a library or just a data set prefix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to consider using an iterated list instead of the do while:&lt;/P&gt;
&lt;PRE&gt;/* if you feel a need to count &amp;amp;sqlobs after the SQL, when it runs correctly, will have the count of items in the list*/*/&lt;BR /&gt;%do i= 1 %to &amp;amp;sysfunc(countw(&amp;amp;split_values));
%let Split_value = %scan(&amp;amp;split_values,&amp;amp;i);&lt;/PRE&gt;
&lt;P&gt;NE and the macro language can be a bit touchy for some things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 11:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919288#M362102</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-07T11:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919293#M362106</link>
      <description>&lt;P&gt;Instead of creating a sequence of DATA steps, create a single step which has all datasets in the DATA statement (first %DO loop) and then uses a SELECT block to output to the respective targets (second %DO loop). This way you read the source dataset only twice.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 12:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919293#M362106</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-07T12:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: In log I am receiving an Error saying ERROR 13-12: Unrecognized SAS option name SQL.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919336#M362119</link>
      <description>Hi All, Thank you for the Suggestions and Corrections. I was able to correct it.</description>
      <pubDate>Thu, 07 Mar 2024 16:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/In-log-I-am-receiving-an-Error-saying-ERROR-13-12-Unrecognized/m-p/919336#M362119</guid>
      <dc:creator>nxmogil</dc:creator>
      <dc:date>2024-03-07T16:16:52Z</dc:date>
    </item>
  </channel>
</rss>

