Initial data (alias, order, header, and scrub lists) are created internally via DATALINES blocks. However, the called macros (%code_diary and %convert_markdown_to_html) process external files (SAS files for %code_diary and Markdown files for %convert_markdown_to_html).
1 Code Block
Macro Inclusion
Explanation : These lines include two SAS macros (`code_diary` and `convert_markdown_to_html`) from the location specified by the `&MACRO_ROOT` macro variable. These macros are essential for the script's documentation generation functionality.
Explanation : This DATA step creates the `work.alias_list` work table which contains short and long keyword pairs. It is used by the `%code_diary` macro to manage section aliases in the generated documentation.
Copied!
data work.alias_list;
infile datalines;
input short_keyword $1-10 long_keyword $11-50;
datalines;
excl exclusion
stat statistics
;
1
DATA work.alias_list;
2
INFILEDATALINES;
3
INPUT short_keyword $1-10 long_keyword $11-50;
4
5
DATALINES;
6
excl exclusion
7
stat statistics
8
;
3 Code Block
DATA STEP Data
Explanation : This DATA step creates the `work.order_list` work table which defines the display order of different sections in the documentation generated by the `%code_diary` macro.
Explanation : This DATA step creates the `work.header_list` work table which associates keywords with section headers for the documentation produced by the `%code_diary` macro.
Copied!
data work.header_list;
infile datalines;
input keyword $1-15 header $16-50;
datalines;
exclusion Exclusion criteria
person Subjects
time Time periods
todo Task list
;
1
DATA work.header_list;
2
INFILEDATALINES;
3
INPUT keyword $1-15 header $16-50;
4
5
DATALINES;
6
exclusion Exclusion criteria
7
person Subjects
8
time Time periods
9
todo Task list
10
;
5 Code Block
DATA STEP Data
Explanation : This DATA step creates the `work.scrub_list` work table which lists keywords for sections to be hidden or scrubbed during documentation generation by the `%code_diary` macro.
Copied!
data work.scrub_list;
infile datalines;
input keyword $1-15;
datalines;
todo
regex
;
1
DATA work.scrub_list;
2
INFILEDATALINES;
3
INPUT keyword $1-15;
4
5
DATALINES;
6
todo
7
regex
8
;
6 Code Block
Macro Call
Explanation : This call to the `%code_diary` macro is the main function of the script. It takes a SAS file (`&DEMO_ROOT.project_main.sas`) as input and, using the previously defined lists (`alias_list`, `order_list`, `header_list`, `scrub_list`), generates two Markdown documentation files (`output-coder.md` and `output-for-all.md`) in the `&DEMO_ROOT` directory.
Explanation : This call to the `%convert_markdown_to_html` macro takes the previously generated Markdown file `output-for-all.md` and converts it into an HTML file (`output-for-all.htm`), also in the `&DEMO_ROOT` directory.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.