SASmarkdown (version 0.4.3)

saslog_hookset: A function to clean SAS log files

Description

The main function here is saslog_hookset, which sets "hooks" for knitr. It can set a "source" hook to clean up SAS logs for the saslog engine, or set an "output" hook to clean up SAS logs written to files and read in using R code.

Used once per hook type per session (i.e. document), during set up.

Usage

saslog_hookset(hooktype)

sasloghook(x, options)

Value

saslog_hookset is used for it's side effect of resetting a knitr hook.

sasloghook returns SAS log output internally to knitr.

Arguments

hooktype

Declare which type of hook to set, "source" (the default) or "output".

options

options are passed to these functions when they are actually invoked within knitr.

x

The log text which is to be cleaned up

Author

Doug Hemken

Details

The main function is used with either "source" or "output" as the value of hooktype.

The end user should not need to use sasloghook directly. This is a workhorse function used to process selected log output. The main use is when set up within knit_hooks$set(source=loghook)

Once this hook is set, the user may then set any chunk options

  • SASproctime

  • SASecho

  • SASnotes

to FALSE to suppress that part of the SAS log.

See Also

knit_hooks

Examples

Run this code
saslog_hookset("source")

if (FALSE) {
indoc <- '
---
title: "Basic SASmarkdown Doc"
author: "Doug Hemken"
output: html_document
---
# In a first code chunk, set up with
```{r}
require(SASmarkdown)
saslog_hookset("source")

sasexe <- "C:/Program Files/SASHome/SASFoundation/9.4/sas.exe"
sasopts <- "-nosplash -ls 75"
```
# Then set up SAS code chunks with
```{r, engine="saslog", engine.path=sasexe, engine.opts=sasopts, SASecho=FALSE}
proc means data=sashelp.class;
run;
```
'
knitr::knit(text=indoc, output="test.md")
rmarkdown::render("test.md")
}

Run the code above in your browser using DataCamp Workspace