Published on :
Reporting CREATION_INTERNE

Code Diary Documentation Generation

This code is also available in: Deutsch Español Français
Awaiting validation
This script configures and executes the automatic documentation process. It starts by including the necessary macro definitions via `%include`. Then, it creates several temporary SAS© tables (`work.alias_list`, `work.order_list`, etc.) containing configuration parameters (aliases, section order, headers). Finally, it calls the `%code_diary` macro to generate the Markdown report and the `%convert_markdown_to_html` macro to produce the HTML version.
Data Analysis

Type : CREATION_INTERNE


Configuration data is created directly in the script via DATA steps using DATALINES.

1 Code Block
INCLUDE
Explanation :
Loading macro libraries located in the directory defined by the `&MACRO_ROOT` macro variable.
Copied!
1%include "&MACRO_ROOT.code_diary.sas";
2%include "&MACRO_ROOT.convert_markdown_to_html.sas";
3 
2 Code Block
DATA STEP Data
Explanation :
Creation of parameter tables (aliases, order, headers, exclusions) necessary for the documentation macro to function.
Copied!
1DATA work.alias_list;
2 INFILE DATALINES;
3 INPUT short_keyword $1-10 long_keyword $11-50;
4 DATALINES;
5excl exclusion
6stat statistics
7;
8 
9DATA work.order_list;
10 INFILE DATALINES;
11 INPUT keyword $1-20 order_no 21-25;
12 DATALINES;
13todo -30
14exclusion -20
15exclusion.time -19
16exclusion.person -18
17methods -10
18no_keyword 0
19;
20 
21DATA work.header_list;
22 INFILE DATALINES;
23 INPUT keyword $1-15 header $16-50;
24 DATALINES;
25exclusion Exclusion criteria
26person Subjects
27time Time periods
28todo Task list
29;
30 
31DATA work.scrub_list;
32 INFILE DATALINES;
33 INPUT keyword $1-15;
34 DATALINES;
35todo
36regex
37;
3 Code Block
MACRO CALL
Explanation :
Execution of the `%code_diary` macro for code analysis and Markdown file generation, followed by conversion to HTML via `%convert_markdown_to_html`.
Copied!
1%code_diary(
2 input_main_file = &DEMO_ROOT.project_main.sas,
3 out_dir = &DEMO_ROOT,
4 out_file = OUTPUT-coder.md,
5 out_file_scrubbed = OUTPUT-for-all.md,
6 debug_mode = 0,
7 section_aliases = work.alias_list,
8 section_order = work.order_list,
9 section_headers = work.header_list,
10 sections_scrubbed = work.scrub_list
11);
12 
13%convert_markdown_to_html(
14 in_file_md = "&DEMO_ROOT.output-for-all.md",
15 out_file_html = "&DEMO_ROOT.output-for-all.htm",
16 debug_mode = 0
17);
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.