I have a newbie question below, Here is the code (I changed the name for security purposes)
proc sql;
/*Create main1 table*/
create table main1 as
select nameid, name,giftid,giftkey,giftplgkey,giftamtplg,
giftamount,gifttype,gifteffdat,chart_lku1
from name_full left outer join gifts_full
on nameid= giftid
quit;
/*Create payments*/
proc sql;
create table main1pay as
select nameid,nameformn,giftid,giftkey,giftplgkey,sum(giftamount) as payments,
gifttype,gifteffdat
from name_full left outer join gifts_full
on nameid=giftid
quit;
Now I want to subtract the sum(giftamount ) in the main1pay table from the giftamount in the main1 table and show the result in a field called PrevBal
Is this handled with a datastep or a new table and how is this done
proc sql;
/*Create main1 table*/
create table main1 as
select nameid, name,giftid,giftkey,giftplgkey,giftamtplg,
giftamount,gifttype,gifteffdat,chart_lku1
from name_full left outer join gifts_full
on nameid= giftid
quit;
/*Create payments*/
proc sql;
create table main1pay as
select nameid,nameformn,giftid,giftkey,giftplgkey,sum(giftamount) as payments,
gifttype,gifteffdat
from name_full left outer join gifts_full
on nameid=giftid
quit;
Now I want to subtract the sum(giftamount ) in the main1pay table from the giftamount in the main1 table and show the result in a field called PrevBal
Is this handled with a datastep or a new table and how is this done