Published on :
Reporting CREATION_INTERNE

Code Diary Documentation Generation

This code is also available in: Français Deutsch Español
Awaiting validation
This program configures the environment for the execution of the `%code_diary` macro. It defines several parameter tables (aliases, order, headers, exclusions) via DATA steps and `datalines`. Then, it executes the `%code_diary` macro to analyze a main project file (`project_main.sas©`) and produce Markdown files (complete and filtered). Finally, it converts the filtered Markdown file to HTML via the `%convert_markdown_to_html` macro.
Data Analysis

Type : CREATION_INTERNE


Configuration tables (alias_list, order_list, header_list, scrub_list) are created directly within the script using the `datalines` statement. File paths are managed via macro variables (`&MACRO_ROOT`, `&DEMO_ROOT`).

1 Code Block
MACRO
Explanation :
Inclusion of external macro definitions necessary for processing: `code_diary` for journal generation and `convert_markdown_to_html` for format conversion.
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 four temporary tables (`work.alias_list`, `work.order_list`, `work.header_list`, `work.scrub_list`) containing the configuration parameters for the documentation (aliases, section order, header labels, and elements to hide).
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
Explanation :
Execution of the main macros: `%code_diary` generates the Markdown files (one for developers, one 'scrubbed' for all) using the previously created configuration tables. Then, `%convert_markdown_to_html` transforms the cleaned Markdown file into an HTML page.
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.