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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 307 views
  • 0 likes
  • 2 in conversation