Hello all, I am brand new to SAS programming and I am trying to learn everything on the go. I managed to complete the SAS Foundations 1 course which helped me greatly, but I am still troubled by some things I am seeing and I hoped that I could get some help here. You can find below a snippet of a long macro definition: data work.&brand._intl_all(keep=walker_gl principal_amt no_cc gbp no_bal no_glcode outrec)
work.&brand._intl_pop(drop= no_cc gbp no_bal no_glcode outrec); * create two SAS tables;
if _n_ eq 1 then
do;
declare hash CC(dataset:"workspds.liq_walker_cc_&YYYY_MM.");
CC.definekey('walker_costcentre');
CC.definedone();
end;
set &libre..liq_&brand._intl_extract_&yyyy_mm. (rename=(derived_cc=WALKER_COSTCENTRE)) end=eof; From my limited understanding, this DATA STEP: imports the &libre..liq_&brand._intl_extract_&yyyy_mm. table creates two new temporary tables based on that: work.&brand._intl_all(keep=walker_gl principal_amt no_cc gbp no_bal no_glcode outrec) work.&brand._intl_pop(drop= no_cc gbp no_bal no_glcode outrec); applies some modifications, i.e. keeping / dropping columns. The thing is that only the first two columns, i.e. walker_gl and principal_amt, are located in the imported table. All others, i.e. no_cc, gbp, no_bal, no_glcode, and outrec, are global variables that were defined at the very top of the program. So, I have two questions: Is work.&brand._intl_all(keep=walker_gl principal_amt no_cc gbp no_bal no_glcode outrec) keeping just those two columns from the imported table and adding the global variables as columns initialized all to 0? What work.&brand._intl_pop(drop= no_cc gbp no_bal no_glcode outrec) is doing? Since all are global variables only existing on the temp table mentioned above (if that is the case), does that mean that is filtering the first temp table and therefore keeping only walker_gl and principal_amt columns? Thank you in advance for your time and help. Regards, Charalampos P.S. I am confident that I am missing or misinterpreting something that more experience programmers will spot right away, that is why I posted just this part of the macro. If more info is needed, I can post the whole macro definition (although it is quite long).
... View more