Really strange join issue.

noetsi

Fortran must die
#1
I did the following code.

Proc SQL;
Create table work.test7 as select distinct cs.cusprofile_An, t1.customerid,

"VR" || substr(cats ("0000000", put(CUSProfile_AN,7.)),length (strip (cats ("0000000", put(CUSProfile_AN,7.))))-6,7) as VRID

from rimsrpt.rptcasesummary cs
right join
work.test3 t1 on cs.customerid = t1.customerid
where cs.extractdate = '30Apr2017'd
order by t1.customerid;
run;

and I get no data at all.

I run the following (all that is different is making it an inner rather than right join) and I get the whole set of data.
Proc SQL;
Create table work.test7 as select distinct cs.cusprofile_An, t1.customerid,

"VR" || substr(cats ("0000000", put(CUSProfile_AN,7.)),length (strip (cats ("0000000", put(CUSProfile_AN,7.))))-6,7) as VRID

from rimsrpt.rptcasesummary cs
join
work.test3 t1 on cs.customerid = t1.customerid
where cs.extractdate = '30Apr2017'd
order by t1.customerid;
run;


I can't imagine any scenario where a right join to a table that has data in it, would result in no data and an inner join would.

Any suggestions would be appreciated. I am really baffled by this.