Hi,
Please, somebody could help me? I don't undersand the LOG. I have no result, because zero rows! Thanks in advance.
Corinne.
Subject: I would like to join 4 tables, see below:
sq.statepopulation sq.regioncode sq.divisioncode sq.statecode
Region (the region code) RegionCode DivisionCode StateCode
Division (the division code) RegionName DivisionName StateName
Name (the state code)
Births3 (an indicator
of state-lvel,
three-year projected births)
My code is:
proc sql feedback;
/*create table toto as*/
select s.Births3 format=ddmmyy10.
,r.RegionName
,d.DivisionName
,t.StateCode
from sq.statepopulation as s inner join
sq.regioncode as r
on s.Region=r.RegionCode inner join
sq.divisioncode as d
on s.Division=d.DivisionCode inner join
sq.statecode as t /*** <--------ISSUE THERE!*/
on s.Name=t.StateName;
quit;
My Log says:
Try doing the joins one at a time and examining the results. That should tell you which particular join is causing problems. I suspect you might be assuming the issue is with your T table. You don't show any specific reason, such as VALUES of any variables that makes T the specific issue.
Make sure that the Name and Statename have the same spellling and case. If one has "NEW YORK" and the other has "New York" then there is no match. Watch for things like leading spaces as well.
You might consider left joins instead of inner. That way you can see if anything from the Statepopulation table has matches on any of the values.
Try doing the joins one at a time and examining the results. That should tell you which particular join is causing problems. I suspect you might be assuming the issue is with your T table. You don't show any specific reason, such as VALUES of any variables that makes T the specific issue.
Make sure that the Name and Statename have the same spellling and case. If one has "NEW YORK" and the other has "New York" then there is no match. Watch for things like leading spaces as well.
You might consider left joins instead of inner. That way you can see if anything from the Statepopulation table has matches on any of the values.
Navigate AI governance with SAS tools for compliance and ethical AI practices. Try SAS Ai Navigator for free for the first six months.
Follow along as SAS’ Robert Blanchard explains three aspects of autotuning in a deep learning context: globalized search, localized search and an in parallel method using SAS.
Find more tutorials on the SAS Users YouTube channel.