Published on :
Macro CREATION_INTERNE

Documentation Automation with Code Diary

This code is also available in: Deutsch Español Français
Awaiting validation
This script loads the necessary macros (`code_diary` and `convert_markdown_to_html`), creates configuration tables (aliases, order, headers, exclusions) using `datalines`, then executes the macros to analyze the `project_main.sas©` file and convert the result to HTML.
Data Analysis

Type : CREATION_INTERNE


Configuration data (aliases, order, headers) is created directly within the script via DATA steps with DATALINES.

1 Code Block
INCLUDE
Explanation :
Inclusion of external macro files required for processing.
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 configuration tables (`work.alias_list`, `work.order_list`, `work.header_list`, `work.scrub_list`) defining the rules for documentation generation (aliases, section order, titles, 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 CALL
Explanation :
Call to the `%code_diary` macro to analyze the source file `project_main.sas` and generate the Markdown output files using the previously created configuration tables.
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 :
Conversion of the scrubbed Markdown file (`output-for-all.md`) into an HTML file for publication.
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.