Please post test data in the form of a datastep:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712
and what you want to see out at the end. Showing some code and saying it doesn't work tells us nothing. We need to be able to see inputs/outputs to have any idea of what is going on.
On your code, I strongly doubt that is the best solution. You are first off selecting all columns from all four tables, e.g. a.*. That cannot be what you want is it? Second you are using left joins, so only data which appears in the preceeding data will appear in the output. So only data in B which has a match in a on the clause will appear, again I highly doubt this is what you mean.
What I would suggest is that you create datasets of the data you actually want, then do a simple merge:
proc sql;
connect to teradata as db(...);
create table a as (select fcl_id,cust_id,app_id,"A" as tab1 from cond1 order by fcl_id,cust_id,app_id);
create table b as (select fcl_id,cust_id,app_id,"B" as tab2 from cond2 order by fcl_id,cust_id,app_id);
create table c as (select fcl_id,cust_id,app_id,"C" as tab3 from cond3 order by fcl_id,cust_id,app_id);
create table d as (select fcl_id,cust_id,app_id,"D" as tab4 from cond4 order by fcl_id,cust_id,app_id);
disconnect from db;
quit;
data want;
merge a b c d;
by fcl_id cust_id app_id;
run;
You will then have a complete list of the merged id variables, and four columns tab1-4 which show presence in each table.
... View more