BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

My coding is running successfully. I have tried to get the confirmed email information and then I am looking for distinct email accounts. But when I see the distinct email account it is giving just the account number. I want the full table of distinct accounts just like in the first code (confirmed email). Can you please suggest what should I change in my code?

 

proc sql;
create table confirmed_email as
select a.*,
b.emailaddress,
b.confirmeddate
from work.Live_phone_numbers as a
inner join p2scflow.emailaddress as b on a.Account_number = b.debt_code
where b.confirmeddate is not missing;
quit;

 

proc sql;
create table distinct_email_accounts as
select distinct
Account_number
from work.confirmed_email;
quit;

 

1 REPLY 1
PaigeMiller
Diamond | Level 26

@Sandeep77 wrote:

Hi Experts,

My coding is running successfully. I have tried to get the confirmed email information and then I am looking for distinct email accounts. But when I see the distinct email account it is giving just the account number. I want the full table of distinct accounts just like in the first code (confirmed email). Can you please suggest what should I change in my code?

 

...

 

proc sql;
create table distinct_email_accounts as
select distinct
Account_number
from work.confirmed_email;
quit;

 


You asked for only Account_number variable in data set distinct_email_accounts. If you want other variables in this data set, you have to put those variable names in the code after select distinct

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 249 views
  • 0 likes
  • 2 in conversation