Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_mdtablewrite.sas File Reference

Create a Markdown Table from a dataset. More...

Go to the source code of this file.

Detailed Description

A markdown table is a simple table representation for use in documents written in markdown format.

An online generator is available here: https://www.tablesgenerator.com/markdown_tables

This structure is also used by the Macro Core library for documenting input/ output datasets, as well as the sasjs/cli tool for documenting inputs/outputs for web services.

We take the standard definition one step further by embedding the informat in the table header row, like so:

|var1:$32|var2:best.|var3:date9.|
|---|---|---|
|some text|42|01JAN1960|
|blah|1|31DEC1999|

Which resolves to:

var1:$32 var2:best. var3:date9.
some text 42 01JAN1960
blah 1 31DEC1999

Usage:

%mp_mdtablewrite(libds=sashelp.class,showlog=YES)

SAS Macros

Parameters
[in]libds=the library / dataset to create or read from.
[out]fref=Fileref to contain the markdown. Default=mdtable.
[out]showlog=set to YES to show the markdown in the log. Default=NO.
Version
9.3
Author
Allan Bowe

Definition in file mp_mdtablewrite.sas.