Assume I have two datasets. One dataset (details) has five variables namely Run_Id,Company_code,Datasource,Table_Name,Table_Count.
Out of these 5 variables, first three variables get data from one program which we no need to worry. Now I've feed the data into last two variables Table_Name and Table_Count based on Run_ID by one program.
I've a program as below which will create three variables - Run_ID,Table_Name,Table_Count
Below program is creating a table called 'Insurance', but I'm not sure how to append/insert data into IFR.Details when Run_ID matches between the datasets Insurance and IFR.Details.
Run_ID in Insurance dataset is extract from other WORK dataset Status_tech.
Proc append below is not working correctly and I'm looking some help here.
At beginning IFR.Details dataset will be like,
Run_ID
Company_code
Datasource
Table_name
Table_count
12345
ABC
Database
12346
DEF
Excel
Insurance dataset will be like,
Run_ID
Table_name
Table_count
12345
Insurance
87
Then I need IFR.Details dataset which should looks like as below. I just have to feed the data to two variables from Insurance dataset when Run_ID matcjes between Insurance and IFR.Details dataset.
Run_ID
Company_code
Datasource
Table_name
Table_count
12345
ABC
Database
Insurance
87
12346
DEF
Excel
options symbolgen mlogic mprint;
%MACRO STATUS_TECH_UPDATE(tab);
%put &tab;
proc sql;
create table &tab as
select
"&tab" as table_name
,count(1) as table_count
,B.run_id
from IFR.&tab A, STATUS_TECH B
where A.RUN_ID = B.RUN_ID;
quit;
/*append/insert data into IFR.Details when Run_ID matches between the datasets Insuarnce and IFR.Details.*/ /*below append is not working as excepted and I'm not sure how to append based on Run_ID*/
proc append base=IFR.Details data=&tab(drop=run_id) force;
run;
%MEND;
%STATUS_TECH_UPDATE(Insurance);
... View more