BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rsadiq1
Calcite | Level 5

Hello

 

I had a question with my query, but I am generating a sas dataset and I have 3 variables out of 10 that are becoming missing for some rows. (AYB modality, engage date, and trigger date) Im not sure if a solution or resolution can come without a code, but these three values are coming up as missing in some rows in the code, while the name, dob, and Account name and all other values are showing up. Is there a way to retrive these missing values? Or are they just missing.

 

 

Thanks

 

Rida

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

When you have a left join, all observations from the "left" dataset will be included; if some of those have no match in the "right" dataset, the variables from there will be set to missing.

View solution in original post

4 REPLIES 4
Rsadiq1
Calcite | Level 5

Well my query is below, but was just asking the question in a general sense

 


 proc sql inobs=max outobs=max;
create table work.modality as
select distinct a.ayb_id,
                        a.type           as AYB_MODALITY        format=$15.,
                        a.activity_dt as AYB_MOD_ENG_DT format=mmddyy10.,
                        a.activity_dt as TRIGGER_DATE          format=mmddyy10.
from rptdata.mbr_activation as a
where a.ayb_id in (select distinct ayb_id from refdata.aybid_nps_master_&rundat.)
    and a.ayb_id in (select distinct ayb_id from  input.ayb_mbr_sbscr_id2_&rundat.)
order by ayb_id
;
quit;

/***
proc print data=work.modality(obs=9);
run;
 ***/

proc sql;

create table sasdata.five as
select distinct a.*,
                    b.AYB_MODALITY,
                    b.AYB_MOD_ENG_DT      format=mmddyy10.,
                    b.TRIGGER_DATE              format=mmddyy10.
from sasdata.four as a
left join
  work.modality as b
  on a.mbr_pgm_id = b.ayb_id
order by a.mbr_id
;
quit;

Kurt_Bremser
Super User

When you have a left join, all observations from the "left" dataset will be included; if some of those have no match in the "right" dataset, the variables from there will be set to missing.

LinusH
Tourmaline | Level 20

Well, as for now, they are "just" missing.

Why, only you can find out. Potential problem can be that they are missing in the source, or if you are performing an outer join, missing values will occurs when the row only will be populated from one table.

Or your query logic.

We need more info (like the source data, query/log) to be able to help you better.

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 993 views
  • 0 likes
  • 3 in conversation