DATA Step, Macro, Functions and more

Covert proc sql to a data step with a embedded query

Reply
N/A
Posts: 0

Covert proc sql to a data step with a embedded query

I'm trying to take the following query and make it into a data step.

select *
from tblAddress
where state not in (select value from tblStates )
and state ne '';

Is this possible with a data step?

I'm new to sas and appreciate everyone for helping me learn it better.

Jerry
Super Contributor
Super Contributor
Posts: 3,174

Re: Covert proc sql to a data step with a embedded query

Yes. One approach is to create a SAS file (and sort it) from your tblStates and then using the DATA step technique, merge the sorted file with your other tblAddress file, using a BY statement.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Covert proc sql to a data step with a embedded query

Scott,
Thank you for your reply.

That helped a lot.

Jerry
Ask a Question
Discussion stats
  • 2 replies
  • 112 views
  • 0 likes
  • 2 in conversation