Published on :
Macro CREATION_INTERNE

Documentation Generation via Code Diary

This code is also available in: Deutsch Español Français
Awaiting validation
This script aims to document the `project_main.sas©` file. It begins by loading the necessary macros (`code_diary.sas©`, `convert_markdown_to_html.sas©`). Then, it creates four temporary SAS© tables in the WORK library via `datalines` to configure the documentation's behavior: section aliases, display order, header labels, and keywords to scrub. Finally, it executes the documentation macro and then the HTML conversion macro.
Data Analysis

Type : CREATION_INTERNE


Configuration data (lists of aliases, orders, headers, and filters) are created directly within the script using DATA steps and the `datalines` statement.

1 Code Block
INCLUDE
Explanation :
Inclusion of source files containing the definitions of the `code_diary` and `convert_markdown_to_html` macros.
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 :
Configuration of documentation parameters via the creation of SAS tables (WORK). These tables define section aliases, sort order, custom titles, and elements to exclude from the final output.
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 to analyze the `project_main.sas` file and generate two Markdown files (a complete version for developers and a scrubbed version).
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);
4 Code Block
MACRO CALL
Explanation :
Call to the utility macro to convert the scrubbed Markdown file into an HTML page.
Copied!
1%convert_markdown_to_html(
2 in_file_md = "&DEMO_ROOT.output-for-all.md",
3 out_file_html = "&DEMO_ROOT.output-for-all.htm",
4 debug_mode = 0
5);
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.