I have this sql proc: proc sql; create table last_positions as select distinct a.*, b.RATING AS numerical_rating from last_positions_temp as a left join &LIB_INP..closed_positions as b on a.NDG = b.NDG and a.extr_dt = b.extr_dt quit; Now, this is the problem: the "RATING" table contains two digit value like "R1", "R2", "R3" up to "R9". I want to keep only the numerical part. I have tried several sintax like substring(b.RATING,2,1) AS numerical_rating or substr (b.RATING,2,1) AS numerical_rating or b.RATING AS numerical_rating = substring(b.RATING,2,1) AS numerical_rating and also other combinations. Every time i get this error message: 551 SUBSTRING(b.RATING,2,1) AS stato_dr - 22 76 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, FROM, 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. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. NOTE: Remote submit to SERV complete. NOTE: Remote submit to SERV commencing. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 47.34 seconds cpu time 0.00 seconds is it possible to acheive the desired result inside the proc sql or should i use a run around of some sort? Thank you
... View more