Demo

org_macro_A

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\demo\org_macro_A.sas

Summary

The A macro, it does everything you could ever wish for.

Usage

Use it wisely

Parameters

- var_99 = Description
- var_100 = Description

Some other heading

More fancy text

org_macro_B

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\demo\org_macro_B.sas

Summary

Macro B for out glorious institute, it just misses the S.

Usage

Like a macro

Parameters

Some other heading

More fancy text

Source

code_diary

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\source\code_diary.sas

Summary

Usage

Comment block

The main file and included scripts need to incorporate specially formatted comment blocks to be included in the output file. An example is:
The special comment block is opened with:/**
The special comment block is closed with:*/
/*
An example of use inside the blocks is:
@main :title The best documentation ever
@main :authors Author One; Author Two; Author Three
@main :org Our Glorious Institute
@main :version 1.2.3
@main A general comment
@def ABC = The alphabet
@stat The p-values are calculated using the carrot test for bunnies
@note I'm writing this example on a Friday afternoon...
A line without keyword

Single line comments

Parsable single line comments are also supported:
The line starts with: **
The line ends with: ;

Document structure

The lines are all grabbed and can be organized by using @keyword for the same themes (e.g. @def in the example, will put all @def lines together). Use . as a seperator for multi-level keywords, e.g. @covar.cost.
There are a few special tags (e.g. @main :title) that grab the document metadata.
If a line within a comment block does not have a keyword it is seen as a continuation of the previous line (in the same block)
The output can be converted to any format (e.g. pdf [needs latex installed], word, html) using pandoc. (See Google for details)
Go to the directory in the command window and use

Parameters

Notes

Example

The following example demonstrates the use of the macro, the section_: inputs should have the same variable names as the example:
data work.alias_list;
infile datalines;
input short_keyword $1-10 long_keyword $11-50;
datalines;
cond condition
cov covariate
covar covariate
def definition
descr descriptive
incl inclusion
excl exclusion
exp exposure
out outcome
var variable
;
data work.order_list;
infile datalines;
input keyword $1-15 order_no 16-20;
datalines;
todo -999
assert -998
main -100
definition -94
variable -92
note -90
inclusion -85
exclusion -80
condition -70
exposure -60
outcome -50
covariate -40
descriptive -30
rate -20
stat -10
no_keyword 0
;
data work.header_list;
infile datalines;
input keyword $1-15 header $16-50;
datalines;
condition Condition criteria
covariate Covariates
definition Definitions
descriptive Descriptive tables
exclusion Exclusion criteria
exposure Exposures
inclusion Inclusion criteria
main Main
no_keyword General
note Notes
outcome Outcomes
rate Rate tables
stat Statistics
todo Task list
variable Variables
;
data work.scrub_list;
infile datalines;
input keyword $1-15;
datalines;
assert
todo
;
%parse_comments(
input_main_file = &SOURCE_ROOT\main_sas.sas,
out_dir = P:\project\
out_file = workplan_coding.txt,
out_file_scrubbed = workplan_output.txt,
section_aliases = work.alias_list,
section_order = work.order_list,
section_headers = work.header_list,
sections_scrubbed = work.scrub_list
);

Final

Authors: Christiaan Righolt
Copyright (c) 2016 Vaccine and Drug Evaluation Centre, Winnipeg.

convert_markdown_to_html

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\source\convert_markdown_to_html.sas

Summary

Macro to convert a markdown style document to html. This is not supposed to supplant proper tools like pandoc, but only to aid visualization on a closed system that does not allow the installation of software.

Usage

The tool automatically creates a table of contents
The tool supports the following markdown markup:
Not supported is:

Parameters

Final

Authors: Christiaan Righolt
Copyright (c) 2016 Vaccine and Drug Evaluation Centre, Winnipeg.

macro_diary

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\source\macro_diary.sas

Summary

Macro to parse documentation for all sas macros and scripts in a root directory.

Usage

See sample_macro_documentation for markup of files.

Parameters

Final

Authors: Christiaan Righolt
Copyright (c) 2016 Vaccine and Drug Evaluation Centre, Winnipeg.

sample_macro_documentation

File location: C:\Users\righoltc\Documents\GitHub\code-diary-sas\source\sample_macro_documentation.sas

Summary

This file is a example/template for macro documentation that describes what sections could be included. This documentation is written in markdown.

Usage

General comments on how to use it. (e.g. macro's to call before and or after this one)
A list of parameters (and their meaning) used in the macro.

Notes

Other detailed information about how to use the macro properly (e.g. details on the format of certain parameters)

Known issues

List of known issues/warnings/etc. for the macro.

Version history

Placeholder copyright line (c).

Files without documentation