Learning SAS? Welcome to the exclusive online community for all SAS learners.

Need guide regarding the following statement!!!

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Need guide regarding the following statement!!!

Hello  i was checking  creaating aa table with proc sql and having a new variable i took it from an article but when i tri this code

 

PROC SQL; CREATE TABLE _NVA_VAR_PROC_SQL AS
SELECT *,
CASE WHEN PRIMDX LIKE'410%' THEN 'MI'
WHEN PRIMDX LIKE'428%' THEN 'CHF'
ELSE 'OTHER'
END AS DXGRP
FROM ADMISIONES;
QUIT;

 

i get this error.

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 /**** CREACION DE UNA NUEVA VARIABLE USANDO PROC SQL ****/
57 PROC SQL;
57 ! CREATE TABLE _NVA_VAR_PROC_SQL AS
58 SELECT *,
59 CASE WHEN PRIMDX LIKE'410%' THEN 'MI'
60 WHEN PRIMDX LIKE'428%' THEN 'CHF'
61 ELSE 'OTHER'
62 END AS DXGRP
63 FROM ADMISIONES;
ERROR: LIKE operator requires character operands.
ERROR: LIKE operator requires character operands.
 
can anybody give me guidance
 
Regards!!!

Accepted Solutions
Solution
‎05-01-2016 04:32 PM
Super User
Posts: 5,437

Re: Need guide regarding the following statement!!!

Posted in reply to Charlypal

So is PRIMDX declared as a character variable?

Data never sleeps

View solution in original post


All Replies
Solution
‎05-01-2016 04:32 PM
Super User
Posts: 5,437

Re: Need guide regarding the following statement!!!

Posted in reply to Charlypal

So is PRIMDX declared as a character variable?

Data never sleeps
New Contributor
Posts: 3

Re: Need guide regarding the following statement!!!

Thanks a lot i was reading an article but in this particular variable was not stated as you said i tried and it worked

 

Regards and my gratitude

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 276 views
  • 0 likes
  • 2 in conversation