1

I want to use YAML for SAS program documentation in a manner similar to how R studio uses YAML. Can I put YAML at the top of my program, then read it into R as some object? The program file would just be a text file called program_1.sas. There would be a bunch of these in a directory or two.

I can then use the object in an R notebook to produce a readable document describing a set of SAS programs. I would have to find a function to display the object in a readable format.

I noticed that this issue is addressed for languages like python and JAVA, but I am hoping to do it in R. Obviously this code has already been written. For example the function yaml_front_matter must do this, but it does not seem to be documented.

If I could also write/change the YAML header that would be a big plus.

Here is an example:

Project: Disease Burden
Directory: /net1/program/
Purpose: Extract Data

The only extra piece is that I would have to comment out this header and also identify it

/*
---
Project: Disease Burden
Directory: /net1/program/
Purpose: Extract Data
---
*/

I could then create markdown like this

# Project: Disease Burden

Directory
: /net1/program/

## Purpose

Extract Data
Harlan Nelson
  • 1,394
  • 1
  • 10
  • 22

0 Answers0