<?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: Describe and Incorrect Syntax Error HELP ME!!! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374060#M89508</link>
    <description>&lt;P&gt;It does not look like you provided the code that is generating the error message.&lt;/P&gt;
&lt;P&gt;If you want to see the code in the include file that corresponds to the error message add the /SOURCE2 option to the %INCLUDE statement.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 18:26:58 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2017-07-07T18:26:58Z</dc:date>
    <item>
      <title>Describe and Incorrect Syntax Error HELP ME!!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/373986#M89494</link>
      <description>&lt;P&gt;Hello everyone! I'm new to writing code and while i'm super excited, i'm definitely feeling the first-timer frustrations. I wrote the following code and received the following errors. I'm totally stuck! Any and all help is appreciated. THANKS A MILLION!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS OBS= MAX;
* Pull claims - CY2016;
PROC SQL;
	%include "!sasroot\Include\Before_Mars4_MDW_dhh.txt";
	CREATE TABLE suicideclaim AS
		select * from connection to oledb

(select CLR_Recip_ID        as RecipID,	       CLC_Claim_ICN           as ICN, 	    
			CLR_Age_In_Years        as Age, 		   CLR_Recip_Parish        as Recip_Par,  
			LPAR_Parish_Desc        as Recip_Parish,   CLR_Race                as Race,         
			ELS_Family_Size         as Family_Size,	   ELS_Household_Size_Code as Household,  
			ELS_Gross_Income        as Gross_income,   ELS_Sex                 as Sex,      
			ELS_Marital_Status_Code as Marital_status, ELS_TANF_Cash_Code      as TANF, 
			ELS_SSI_Code            as SSI,            CLR_Aid_Category        as AC,
			CLC_Diag_Code_1         as Diag_1,	  	   CLC_Diag_Code_2         as Diag_2, 	       
            CLDX10_Diag_Code_1      as Dx10_1, 	       CLDX10_Diag_Code_2      as Dx10_2, 
            CLC_Service_from_date   as DOS,		       CLQ_Units_Of_Serv       as Unit,  
			CLP_Serv_Prov_Id        as ProvID, 	  	   CLP_Serv_Prov_Spec1     as PS,    	
			CLP_Serv_Prov_Type      as PT,     		   CLP_Serv_Prov_Parish    as Prov_Par,   
			LPPAR_Parish_Desc       as Prov_Parish,    CLR_Type_Case           as TC,
			Case
				where CLR_Age_In_Years ge 25
and where substr(LDC10_Diag_Code,1,3) in ('X40','X41','X42','X46','X47','Y10','Y11',
		'Y12','Y16','Y17','Y870','T39', 'T40', 'T423', 'T424', 'T427', 'T43', 'T509',
		'T58', 'X44')
		OR substr(LDC10_Diag_Code,1,3) BETWEEN 'X60' AND 'X84' 
		OR LDC10_Diag_Code = 'T1491'
			
		from CLQ 
			inner join CLC    on CLQ_Time_Key = CLC_Time_Key    and CLQ_Claim_Key = CLC_Claim_Key 
			inner join CLR    on CLQ_Time_Key = CLR_Time_Key    and CLQ_Claim_Key = CLR_Claim_Key  
			inner join CLP    on CLQ_Time_Key = CLP_Time_Key    and CLQ_Claim_Key = CLP_Claim_Key

			inner join CLDX10 on CLQ_Time_Key = CLDX10_Time_Key and CLQ_Claim_Key = CLDX10_Claim_Key

			left  join LPAR  on CLR_Recip_Parish     = LPAR_Parish_Code
			left  join LPPAR on CLP_Serv_Prov_Parish = LPPAR_Parish_Code
			left  join ELS   on CLR_Recip_Id = ELS_Elig_Id
		
			where CLQ_Time_Key &amp;gt;= 201601 
				and CLC_Service_From_Date between 20160101 and 20161231
				and CLQ_claim_status in ('1', '2')
				and CLQ_Transaction_Type in (1, 2)
				
		); 
%include "!sasroot\Include\after_sql.txt"; 
PROC SQL
CREATE TABLE obhdata.azc_suicidegrant_07072017 AS 
   SELECT *
      FROM suicideclaim
	where substr(LDC10_Diag_Code,1,3) in ('X40','X41','X42','X46','X47','Y10','Y11',
		'Y12','Y16','Y17','Y870','T39', 'T40', 'T423', 'T424', 'T427', 'T43', 'T509',
		'T58', 'X44')
		AND substr(LDC10_Diag_Code,1,3) BETWEEN 'X60' AND 'X84' 
		AND LDC10_Diag_Code = 'T1491'
group by LPAR_Parish_Desc;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The errors are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be completed.: Statement(s) could not be&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;prepared.: Incorrect syntax near the keyword 'where'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL&lt;/P&gt;&lt;P&gt;88 CREATE TABLE obhdata.azc_suicidegrant_07062017 AS&lt;/P&gt;&lt;P&gt;______&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, BUFFERSIZE, CHECK, CODEGEN, CONSTDATETIME, DOUBLE, DQUOTE,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERRORSTOP, EXEC, EXITCODE, FEEDBACK, FLOW, INOBS, IPASSTHRU, LOOPS, NOCHECK, NOCODEGEN, NOCONSTDATETIME, NODOUBLE,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;NOERRORSTOP, NOEXEC, NOFEEDBACK, NOFLOW, NOIPASSTHRU, NONUMBER, NOPRINT, NOPROMPT, NOREMERGE, NOSORTMSG, NOSTIMER,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;NOSTOPONTRUNC, NOTHREADS, NOWARNRECURS, NUMBER, OUTOBS, PRINT, PROMPT, REDUCEPUT, REDUCEPUTOBS, REDUCEPUTVALUES,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;REMERGE, SORTMSG, SORTSEQ, STIMER, STOPONTRUNC, THREADS, UNDO_POLICY, WARNRECURS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 14:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/373986#M89494</guid>
      <dc:creator>acorey25</dc:creator>
      <dc:date>2017-07-07T14:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Describe and Incorrect Syntax Error HELP ME!!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/373991#M89496</link>
      <description>&lt;P&gt;I see two issues:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) PROC SQL; - shopuld end with semicolon. It is missing on the second one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Your first lines are:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS OBS= MAX;
* Pull claims - CY2016;
PROC SQL;
	%include "!sasroot\Include\Before_Mars4_MDW_dhh.txt";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;shouldn't &amp;nbsp;the &lt;STRONG&gt;%include&lt;/STRONG&gt;&amp;nbsp;line &lt;U&gt;precede&lt;/U&gt; &lt;STRONG&gt;proc sql; &lt;/STRONG&gt;line ?!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 14:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/373991#M89496</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-07T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Describe and Incorrect Syntax Error HELP ME!!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374060#M89508</link>
      <description>&lt;P&gt;It does not look like you provided the code that is generating the error message.&lt;/P&gt;
&lt;P&gt;If you want to see the code in the include file that corresponds to the error message add the /SOURCE2 option to the %INCLUDE statement.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 18:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374060#M89508</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-07T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Describe and Incorrect Syntax Error HELP ME!!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374088#M89514</link>
      <description>&lt;P&gt;Thank you so much! The missing semi-colon on PROC SQL was an issue. I've fixed it. The code is working now. Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 20:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374088#M89514</guid>
      <dc:creator>acorey25</dc:creator>
      <dc:date>2017-07-07T20:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Describe and Incorrect Syntax Error HELP ME!!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374508#M89690</link>
      <description>&lt;P&gt;Hi Tom! I was able to solve this issue. My coworker looked through the code and found where I was missing the correct syntax (when versus where).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Describe-and-Incorrect-Syntax-Error-HELP-ME/m-p/374508#M89690</guid>
      <dc:creator>acorey25</dc:creator>
      <dc:date>2017-07-10T14:09:06Z</dc:date>
    </item>
  </channel>
</rss>

