Help using Base SAS procedures

NEED to Change below code in to sql

Reply
Occasional Contributor
Posts: 5

NEED to Change below code in to sql

%prvadit(2); %prvadit(3); %prvadit(4); %prvadit(5); %prvadit(9);

proc sql;

  create table prvadr as

  select prpr_id, prad_state, prad_zip, min(datepart(prad_eff_dt)) as effdt,

  max(datepart(prad_term_dt)) as trmdt

  from prvadr2

  group by prpr_id, prad_state, prad_zip;

quit;

Super User
Posts: 17,831

Re: NEED to Change below code in to sql

It is SQL....

Occasional Contributor
Posts: 5

Re: NEED to Change below code in to sql

i need to change above code to Microsoft SQl code i am not understanding few lines here

What does mean ; %prvadit(2); %prvadit(3); %prvadit(4); %prvadit(5); %prvadit(9);

and what is proc sql;

                  quit;

Super User
Posts: 5,257

Re: NEED to Change below code in to sql

First, you are asking for SQL Server guidance, that is better searched for elsewhere.

Second, those are macro calls. You need to find and look into those macro definition to see what they mean.

Sounds like you are migrating a SAS application to SQL Server, so perhaps the SAS community might have mixed feelings about helping you out... ;-)

Data never sleeps
Super User
Posts: 17,831

Re: NEED to Change below code in to sql

I only do when it's for free, if I'm being paid then it's fine Smiley Happy

Hire a SAS/SQL consultant to do the work.

But I'm pretty sure someone else will answer the question as well.

Ask a Question
Discussion stats
  • 4 replies
  • 183 views
  • 0 likes
  • 3 in conversation