Desktop productivity for business analysts and programmers

missing values

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

missing values

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


Accepted Solutions
Solution
‎05-24-2017 09:47 AM
Esteemed Advisor
Posts: 6,669

Re: missing values

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,669

Re: missing values

Post the input dataset(s) for the query (use a datastep as described in https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...), and the query code.

How are we supposed to help with your data and/or code if we know neither?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 18

Re: missing values

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;

Solution
‎05-24-2017 09:47 AM
Esteemed Advisor
Posts: 6,669

Re: missing values

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Esteemed Advisor
Posts: 5,198

Re: missing values

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
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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