BookmarkSubscribeRSS Feed
omega1983
Calcite | Level 5


Here is a snippet of code I used in a report that ran smoothly:

((b.REC_CHNG_CD IN ('A','C') and

  (a.LN_BA > 0 and

      &elapse >=0 ) and

        (a.iv_id not like 'Z%' or

         a.iv_id not like 'A%') and

         b.hz_ins_co_cd in ('NEWLN','MAINT','')));

I have another report that is very similar although some of the fields are different.  It seems pretty straight forward but I am getting

((d.REC_CHNG_CD IN ('A','C') and

        (a.LN_BA >0 and

             d.LN_HAZARD_TABLE_FG = 'N'  and

    (a.ix_id not in('Cx2','d01','f10','Z55') or

         a.iv_id not like 'F%') and

      (a.PR_TYPE_CD not in('C','3') and

             b.ins_co_cd in ('NEWLN','MAINT','')));

                                                      _

                                                       22

                                                       76

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ,

              EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=. 

ERROR 76-322: Syntax error, statement will be ignored.

   

2 REPLIES 2
PGStats
Opal | Level 21

Your parentheses are not balanced, hence the syntax error.

PG

PG
ballardw
Super User

The enhanced editor key combination of Ctrl ( when the cursor is placed on a paranthesis, bracket or brace will find the matching one. If the cursor doesn't move then it is unbalanced.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 639 views
  • 0 likes
  • 3 in conversation