Help using Base SAS procedures

PROC SQL: dropping an entry from list

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

PROC SQL: dropping an entry from list

Hello! So I need to create a list using proc sql because I am running a statistical test that runs a bunch of tests cross referencing the variables called for in the variable list.

 

My proc sql code is:

proc sql noprint;
select name into :tier1snps separated by ' '
from dictionary.columns
where libname=upcase("work") and memname=upcase("domsnp")
and (substr(name, 1, 3) in ('dom') or substr(name,1) in ('DOM_RS10462018','DOM_RS7107287','DOM_RS11022778','DOM_RS969485'));

quit;

 

The list I get when I do %put &tier1snps is:

DOM_RS10462018 dom_rs12915776 dom_rs8041466 dom_rs4775351 dom_rs34720147

dom_rs2305159 DOM_RS7107287 dom_rs1801260 dom_rs1982350 DOM_RS969485

dom_rs2414680 dom_rs11071557 dom_rs809736 dom_rs782931 dom_rs4774388

DOM_RS11022778 dom_rs13329238 dom_rs12906588 dom_rs738499 dom_rs5758324

dom_rs8023563
dom_rs16943472 dom_rs2267150

 

I want to get rid of the last entry "dom_rs2267150" but I cannot figure out how to manually drop entries, although I figured out how to manually add entries. This would be a great help! Thank yo uso much!


Accepted Solutions
Solution
‎11-27-2016 03:05 AM
Super User
Posts: 17,829

Re: PROC SQL: dropping an entry from list

Add another condition to your query:

 

And name not in (exclusion list);

View solution in original post


All Replies
Solution
‎11-27-2016 03:05 AM
Super User
Posts: 17,829

Re: PROC SQL: dropping an entry from list

Add another condition to your query:

 

And name not in (exclusion list);

New Contributor
Posts: 3

Re: PROC SQL: dropping an entry from list

Thank you so much! That worked perfectly!
☑ This topic is SOLVED.

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

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