sas_collectcode()
if (FALSE) {
indoc <- '
---
title: "Basic SASmarkdown Doc"
author: "Doug Hemken"
output: html_document
---
# In a first code chunk, set up with
```{r}
require(SASmarkdown)
sasexe <- "C:/Program Files/SASHome/SASFoundation/9.4/sas.exe"
sasopts <- "-nosplash -ls 75"
```
# Then mark SAS code chunks with collectcode=TRUE
```{r, engine="sas", engine.path=sasexe, engine.opts=sasopts, collectcode=TRUE}
data class;
set sashelp.class;
keep age;
run;
```
# A later chunk that depends on the first.
```{r, engine="sas", engine.path=sasexe, engine.opts=sasopts}
proc means data=class; /* not SASHELP.class */
run;
```
'
knitr::knit(text=indoc, output="test.md")
rmarkdown::render("test.md")
}
Run the code above in your browser using DataLab