DATA Step, Macro, Functions and more

49: LINE and COLUMN cannot be determined. when creating a macro variable with proc sql

Accepted Solution Solved
Reply
Contributor
Posts: 43
Accepted Solution

49: LINE and COLUMN cannot be determined. when creating a macro variable with proc sql

So, I am trying to create a macro variable to store a list of codes that I will use in an in statement, but it is missing the first and last quotation mark which I will add later, but just trying to %put &icd causes the line and column error.  Any suggestions? 

 

proc sql;
select icd_code into :icd separated by "','" from ds ;
quit;

 

%let pq = %str(%(%');
%let qp = %str(%'%));

if icd in  &pq&icd&qp then etc. etc.  


Accepted Solutions
Solution
‎03-28-2018 06:52 PM
Super User
Posts: 6,899

Re: 49: LINE and COLUMN cannot be determined. when creating a macro variable with proc sql

Make it easy instead of making it difficult:

 

proc sql;
select quote(icd_code) into :icd separated by ' ' from ds ;
quit;

 

if icd in  (&icd) then

View solution in original post


All Replies
Solution
‎03-28-2018 06:52 PM
Super User
Posts: 6,899

Re: 49: LINE and COLUMN cannot be determined. when creating a macro variable with proc sql

Make it easy instead of making it difficult:

 

proc sql;
select quote(icd_code) into :icd separated by ' ' from ds ;
quit;

 

if icd in  (&icd) then

Super User
Posts: 2,492

Re: 49: LINE and COLUMN cannot be determined. when creating a macro variable with proc sql

Posted in reply to Astounding

Or

proc sql;
select quote(trim(icd_code)) into :icd separated by ' ' from ds ;
quit;

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 345 views
  • 5 likes
  • 3 in conversation