DATA Step, Macro, Functions and more

Whats Wrong with my code

Occasional Contributor
Posts: 12

Whats Wrong with my code

Proc SQL;
create table moth as
Select distinct a.motherid, a.perid as kidid,
a.tage as kidage, a.esex as kidgender, a.EHLTSTAT as kid_currhealth ,
a.EHOSPNIT as kid_nightsinhosp, a.EVISDOC as kid_docvisit
from momkid a, wave5top b
where a.motherid=b.perid
and a.tage lt 18
order by a.motherid, a.tage;


Th log is not showing any errors its just showing 0 observations 

0 rows 7 columns

Super User
Super User
Posts: 8,115

Re: Whats Wrong with my code

No records met your WHERE criteria. Without seeing the data hard to tell if there is any error or not.

New Contributor
Posts: 3

Re: Whats Wrong with my code

Check if you have kidid in table momkid ? (a.kidid = b.kidid)

Super User
Posts: 13,563

Re: Whats Wrong with my code

Some Possible causes

1) No matching Momid = Perid

2) no tage lt 18


3) None of the matching Momid=Perid have tage lt 18

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation