Hi GP
What do you want documented from your SAS code ?
If you want to document your input and output data, its not that simple - because you will have to build your own parser because of the many many ways sas data can be referenced in the SAS code (i.e. datasets, proc's etc and macro var. ref.).
If you want to have basic metadata about your program, like who developed it, when, description, status etc. you can do this by using a standard header in all your programs (at the top). You will need to infile all your sas files in a datastep, and read your header information into a SAS dataset.
Its not necessary to write a macro, a normal SAS program can do the job just fine.
i.e try this mock-up (has to be refined before use - not tested)
[pre]
Filename dirlist pipe 'dir p:\*.sas /B';
data fnames(keep=filename);
infile dirlist pad missover;
input @1 filename $62.;
run;
data sascode;
retain file;
length string $120;
set fnames(keep=filename obs=10);
infile dummy filevar=filename end=done dsd;
file=filename;
do while(not done);
input string :$120.;
output;
end;
run;
[/pre]
You will have to do some IF testing using substr(), index() etc. when reading your standard header.
See the following papers for ideas
http://www2.sas.com/proceedings/sugi25/25/cc/25p074.pdf
http://www2.sas.com/proceedings/sugi27/p208-27.pdf
http://www2.sas.com/proceedings/sugi29/258-29.pdf