<?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: ORACLE prepare error: ORA-00933: SQL command not properly ended. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916684#M361054</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1     %studio_hide_wrapper;
MLOGIC(STUDIO_HIDE_WRAPPER):  Beginning execution.
NOTE: The macro STUDIO_HIDE_WRAPPER is executing from memory.
      48 instructions 1088 bytes.
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studionotes = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MPRINT(STUDIO_HIDE_WRAPPER):   options nonotes;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiosource = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MPRINT(STUDIO_HIDE_WRAPPER):   options nosource;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiostimer = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MPRINT(STUDIO_HIDE_WRAPPER):   options nostimer;
MLOGIC(STUDIO_HIDE_WRAPPER):  Ending execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  Beginning execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MPRINT(STUDIO_RESTORE_WRAPPER):   options NOTES;
MPRINT(STUDIO_RESTORE_WRAPPER):   options SOURCE;
MPRINT(STUDIO_RESTORE_WRAPPER):   options STIMER;
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MLOGIC(STUDIO_RESTORE_WRAPPER):  Ending execution.
83    %put &amp;amp;=start.;
START='2023-02-01'
84    %put &amp;amp;=end.;
END='2024-02-10'
85    %put &amp;amp;=role1.;
ROLE1='000666666','000777777','000555555','000444444','999KR','A222','AARRRRRR','AHAJER8','EINSKIL9','ECURIP9','EMCEER7'
86    
87    
88    %studio_hide_wrapper;
MLOGIC(STUDIO_HIDE_WRAPPER):  Beginning execution.
NOTE: The macro STUDIO_HIDE_WRAPPER is executing from memory.
      48 instructions 1088 bytes.
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studionotes = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MPRINT(STUDIO_HIDE_WRAPPER):   options nonotes;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiosource = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MPRINT(STUDIO_HIDE_WRAPPER):   options nosource;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiostimer = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MPRINT(STUDIO_HIDE_WRAPPER):   options nostimer;
MLOGIC(STUDIO_HIDE_WRAPPER):  Ending execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  Beginning execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MPRINT(STUDIO_RESTORE_WRAPPER):   options NOTES;
MPRINT(STUDIO_RESTORE_WRAPPER):   options SOURCE;
MPRINT(STUDIO_RESTORE_WRAPPER):   options STIMER;
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MLOGIC(STUDIO_RESTORE_WRAPPER):  Ending execution.
99    
100   &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Feb 2024 15:02:57 GMT</pubDate>
    <dc:creator>bhca60</dc:creator>
    <dc:date>2024-02-18T15:02:57Z</dc:date>
    <item>
      <title>ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916650#M361031</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
     connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); 

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.act_dttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.crusid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm,
         			 c.mktcd,
                                 c.srcstcd,
                                 d.pur_id,
                                 d.bol_cd,
                                 d.clmplcd,
			         d.ent,
                             case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
                                  else 'INE'
                             end as Business,
                                 d.plancd
          
                    from dra.rsh_dra_snart_act as a

                       left join dra.rsh_dra_case as c
                          on a.id = c.id

                       left join dra.rsh_dra_nonmdm_mbr as d
                          on c.id = d.id 
				
                          where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.crusid in (&amp;amp;role1.)
                            and (c.srcstcd not in ('5','6') or c.srcstcd is null)
                            and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
        
                          order by a.id, a.act_dttm);
                         
     disconnect from test;
quit;

ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What could be causing this error? I've never seen this one before. I am in SAS Studio connecting to Oracle. I dont know if it doesnt like the order by or what.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 03:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916650#M361031</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T03:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916653#M361032</link>
      <description>&lt;P&gt;You're script is missing a comma.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1708225866181.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93893i8858D19AE4E2E8E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1708225866181.png" alt="Patrick_0-1708225866181.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 03:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916653#M361032</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-18T03:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916656#M361033</link>
      <description>&lt;P&gt;I accidentally removed that comma; it's not missing a comma in the original run and it still gives that error.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 03:31:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916656#M361033</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T03:31:41Z</dc:date>
    </item>
    <item>
      <title>ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916659#M361036</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
     connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); 

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.act_dttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.crusid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm,
         			 c.mktcd,
                                 c.srcstcd,
                                 d.pur_id,
                                 d.bol_cd,
                                 d.clmplcd,
			         d.ent,
                             case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
                                  else 'INE'
                             end as Business,
                                 d.plancd
          
                    from dra.rsh_dra_snart_act as a

                       left join dra.rsh_dra_case as c
                          on a.id = c.id

                       left join dra.rsh_dra_nonmdm_mbr as d
                          on c.id = d.id 
				
                          where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.crusid in (&amp;amp;role1.)
                            and (c.srcstcd not in ('5','6') or c.srcstcd is null)
                            and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
        
                          order by a.id, a.act_dttm);
                         
     disconnect from test;
quit;

ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What could be wrong ? Is it because it's a subquery using an order by?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 04:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916659#M361036</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T04:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916660#M361034</link>
      <description>&lt;P&gt;There is an easy way to find errors in SQL since SQL is not very good in locating where errors are and that is to simplify your query to the point that it works, then step by step add more lines back in until you get the error. This would be be a good starting point:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
     connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); 

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.act_dttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.crusid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm

                    from dra.rsh_dra_snart_act as a

   where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.crusid in (&amp;amp;role1.)
                          order by a.id, a.act_dttm);
                         
     disconnect from test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that works, then add new code, line by line. If it doesn't then your macro variable values could be the problem. Replace these with hard-coded values to see if that fixes the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 04:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916660#M361034</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-02-18T04:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916662#M361035</link>
      <description>&lt;P&gt;The roleid is working fine - it looks like it is recognized in the program because a list of ids show in the log. It may have something do with the order by and it being a subquery?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 05:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916662#M361035</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T05:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916670#M361042</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290946"&gt;@bhca60&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The roleid is working fine - it looks like it is recognized in the program because a list of ids show in the log. It may have something do with the order by and it being a subquery?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then may-be share the log with us - run with options mprint set so can see to what macro variables like &amp;amp;start resolve.&lt;/P&gt;
&lt;P&gt;It's unlikely the order by clause because for Oracle that's not within a sub-query. But agree that it would be cleaner to have it on the SAS side.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1708250118180.png" style="width: 822px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93897i7558E68C1309920B/image-dimensions/822x81?v=v2" width="822" height="81" role="button" title="Patrick_0-1708250118180.png" alt="Patrick_0-1708250118180.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 09:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916670#M361042</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-18T09:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916671#M361043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does your situation fit the SAS&amp;nbsp;&lt;A href="https://support.sas.com/kb/39/997.html" target="_blank" rel="noopener"&gt;Problem Note 39997: A database error can occur when you submit an SQL query with a LIBNAME statement that uses the MULTI_DATASRC_OPT=IN_CLAUSE option&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 10:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916671#M361043</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2024-02-18T10:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916676#M361048</link>
      <description>&lt;P&gt;Please do not double-post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is contained in your macro variables? Run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;=start.;
%put &amp;amp;=end.;
%put &amp;amp;=role1.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;immediately before invoking PROC SQL, and post the log.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 11:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916676#M361048</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-18T11:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916684#M361054</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1     %studio_hide_wrapper;
MLOGIC(STUDIO_HIDE_WRAPPER):  Beginning execution.
NOTE: The macro STUDIO_HIDE_WRAPPER is executing from memory.
      48 instructions 1088 bytes.
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studionotes = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MPRINT(STUDIO_HIDE_WRAPPER):   options nonotes;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiosource = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MPRINT(STUDIO_HIDE_WRAPPER):   options nosource;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiostimer = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MPRINT(STUDIO_HIDE_WRAPPER):   options nostimer;
MLOGIC(STUDIO_HIDE_WRAPPER):  Ending execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  Beginning execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MPRINT(STUDIO_RESTORE_WRAPPER):   options NOTES;
MPRINT(STUDIO_RESTORE_WRAPPER):   options SOURCE;
MPRINT(STUDIO_RESTORE_WRAPPER):   options STIMER;
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MLOGIC(STUDIO_RESTORE_WRAPPER):  Ending execution.
83    %put &amp;amp;=start.;
START='2023-02-01'
84    %put &amp;amp;=end.;
END='2024-02-10'
85    %put &amp;amp;=role1.;
ROLE1='000666666','000777777','000555555','000444444','999KR','A222','AARRRRRR','AHAJER8','EINSKIL9','ECURIP9','EMCEER7'
86    
87    
88    %studio_hide_wrapper;
MLOGIC(STUDIO_HIDE_WRAPPER):  Beginning execution.
NOTE: The macro STUDIO_HIDE_WRAPPER is executing from memory.
      48 instructions 1088 bytes.
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_HIDE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studionotes = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MPRINT(STUDIO_HIDE_WRAPPER):   options nonotes;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiosource = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MPRINT(STUDIO_HIDE_WRAPPER):   options nosource;
MLOGIC(STUDIO_HIDE_WRAPPER):  %IF condition &amp;amp;_studiostimer = is TRUE
MLOGIC(STUDIO_HIDE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MPRINT(STUDIO_HIDE_WRAPPER):   options nostimer;
MLOGIC(STUDIO_HIDE_WRAPPER):  Ending execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  Beginning execution.
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIONOTES
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSOURCE
MLOGIC(STUDIO_RESTORE_WRAPPER):  %GLOBAL  _STUDIOSTIMER
MPRINT(STUDIO_RESTORE_WRAPPER):   options NOTES;
MPRINT(STUDIO_RESTORE_WRAPPER):   options SOURCE;
MPRINT(STUDIO_RESTORE_WRAPPER):   options STIMER;
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIONOTES)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSOURCE)
MLOGIC(STUDIO_RESTORE_WRAPPER):  %LET (variable name is _STUDIOSTIMER)
MLOGIC(STUDIO_RESTORE_WRAPPER):  Ending execution.
99    
100   &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Feb 2024 15:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916684#M361054</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T15:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916689#M361057</link>
      <description>&lt;P&gt;One thing I see: you create act_dttm on the SAS side:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;crdttm as act_dttm format=datetime24.3&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but you also use it in the pass-through on the Oracle side&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where trunc(a.act_dttm)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 15:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916689#M361057</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-18T15:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916690#M361058</link>
      <description>I dont see that error</description>
      <pubDate>Sun, 18 Feb 2024 15:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916690#M361058</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T15:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916691#M361059</link>
      <description>&lt;P&gt;Should one of them be removed?&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 16:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916691#M361059</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T16:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916697#M361065</link>
      <description>&lt;P&gt;You need to know your data (Maxim 3).&lt;/P&gt;
&lt;P&gt;Is act_dttm actually present in the database table? If not, this could be the root cause of your problems.&lt;/P&gt;
&lt;P&gt;If it is, in what relation is it to crddtm? If it contains different logical data, I find it problematic to give it the same name.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 17:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916697#M361065</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-18T17:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916711#M361079</link>
      <description>&lt;P&gt;You're right there was a field that needed to be updated; now crusid is inptid ; I replaced in the two spots - in the select and the where statement and still got the error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
     connect to oracle as test (user=%SUPERQ(dra_u) password="&amp;amp;dra_p." path=huvhg); 

        create table now1(drop=crdttm) as
           select *, 
		  crdttm as act_dttm format=datetime24.3
			from connection to test
                (select distinct a.avdttm,
                                 a.id,
                                 a.acttpcd,
                                 a.actrscd,
                                 a.actotcom_cd,                            
                                 a.inptid as emp_id,
                                 a.cmtrid,
                                 a.act_dttm as crdttm,
         			 c.mktcd,
                                 c.srcstcd,
                                 d.pur_id,
                                 d.bol_cd,
                                 d.clmplcd,
			         d.ent,
                             case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
                                  else 'INE'
                             end as Business,
                                 d.plancd
          
                    from dra.rsh_dra_snart_act as a

                       left join dra.rsh_dra_case as c
                          on a.id = c.id

                       left join dra.rsh_dra_nonmdm_mbr as d
                          on c.id = d.id 
				
                          where trunc(a.act_dttm) between to_date(&amp;amp;start.,'yyyy-mm-dd') and to_date(&amp;amp;end.,'yyyy-mm-dd')
                            and a.inptid in (&amp;amp;role1.)
                            and (c.srcstcd not in ('5','6') or c.srcstcd is null)
                            and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
        
                          order by a.id, a.act_dttm);
                         
     disconnect from test;
quit;

ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Feb 2024 22:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916711#M361079</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2024-02-18T22:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916712#M361080</link>
      <description>&lt;P&gt;As I've already suggested, simplify your query until it works, then progressively add lines back in until it fails. It's a lot easier to fix SQL when you know which line(s) is causing the problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 22:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/916712#M361080</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-02-18T22:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/947257#M370843</link>
      <description>&lt;P&gt;ORA-00933 points to a sql syntax error. check the query for formatting issues or missing keywords. And if you're thinking to bringing cocker spaniel, first must go thought this comparison &lt;A href="https://oddbitsdaily.com/working-vs-show-cocker-spaniel/" target="_self"&gt;on show and working spaniels&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 12:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-ORACLE-prepare-error-ORA-00933-SQL-command-not-properly/m-p/947257#M370843</guid>
      <dc:creator>Finn-Ol</dc:creator>
      <dc:date>2024-10-13T12:31:44Z</dc:date>
    </item>
  </channel>
</rss>

