BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rsadiq
Calcite | Level 5

Hello I keep getting an error in my code (not sure what it is) Ive been trying everything but maybe I'm just not seeing it

My code is below followed by the error. Thank you!

     proc sql ;
       create table pharmacy_consults1  as
        select distinct
                       mbr_id
                      ,ACTV_STRT_DTTM
                      ,case when ACTV_TYP_ID in ('121') and RSLV_OTCOME_TYP_ID in ('369') then 1
                         else 0    end                       format=6.           as REFERRALS
                         ,CREATDT as ACTVCREATDT
                      from activities_mbr
                    where ((ACTV_STRT_DTTM is not null and ACTV_STRT_DTTM between "&beg_dt."d and "&end_dt."d) or
                           (ACTVCREATDT is not null  and ACTVCREATDT between "&beg_dt."d and "&end_dt."d)))
              group by mbr_id) ;
     quit ;

 


NOTE: Line generated by the invoked macro "CA_STEP2".
1024        "&end_dt."d) or                             (ACTVCREATDT is not null  and ACTVCREATDT
1024     ! between "&beg_dt."d and "&end_dt."d)))               group by mbr_id) ;      quit ;
                                                _                              _
                                                22                             79
                                                200
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *, **, +, -, /, <, <=, <>,
              =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, EXCEPT, GE, GET, GROUP, GT, GTT,
              HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ORDER,
              OUTER, UNION, ^, ^=, |, ||, ~, ~=. 

ERROR 79-322: Expecting a (.

1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
Reeza
Super User

It’s an issue with the parenthesis. 

 

Remove all of your filters and add them back one by one until you see where the issue is. 

PGStats
Opal | Level 21

There should not be a closing parenthesis after the group by clause.

PG
jklaverstijn
Rhodochrosite | Level 12

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 969 views
  • 2 likes
  • 5 in conversation