Hemken / SASmarkdown

A collection of R functions that extends knitr's capability for using SAS as a language engine
Other
21 stars 5 forks source link

Provide server credentials to SAS engine #15

Closed tisseuil closed 2 years ago

tisseuil commented 3 years ago

Hi,

When trying run sas chunck code, I need to provide my SASapp server credentials.

I have tried to pass different options to the sasopts argument without success.

Anu sggestions ?


# load the SASmarkdown package
library(SASmarkdown)

# set up the options so that knit knows where you SAS executable is
# set the linesize to be easily readable on letter size paper, portrait
# and set the knir options using opts_chunk$set().
saspath <- "C:/Program Files (x86)/SASHome/x86/SASEnterpriseGuide/7.1/SEGuide.exe" 
sasopts <- "-nosplash -linesize 75 -password_on_stdin true -metauser xxxx-metapass xxxx -user_ID xxxx-password xxxx-serverusername xxxx-serverpassword xxxx"

knitr::opts_chunk$set(engine="sas", engine.path=saspath,engine.opts=sasopts, comment=NA)

# run these commands to convince yourself that
# within this knitr session the engine changed.
knitr::opts_chunk$get()$engine
knitr::opts_chunk$get()$engine.path
knitr::opts_chunk$get()$engine.opts
data _null_;
put 'Hello, world!';
run;
Hemken commented 3 years ago

To my knowledge, SAS Enterprise Guide does not run in batch mode, you need the classic SAS executable instead.

Doug Hemken

Statistical consultant Social Science Computing Cooperative Univ. of Wisc. – Madison

dehemken@wisc.edumailto:dehemken@wisc.edu 608-262-4327

From: tisseuil notifications@github.com Sent: Thursday, March 4, 2021 10:13 AM To: Hemken/SASmarkdown SASmarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/SASmarkdown] Provide server credentials to SAS engine (#15)

Hi,

When trying run sas chunck code, I need to provide my SASapp server credentials.

I have tried to pass different options to the sasopts argument without success.

Anu sggestions ?

load the SASmarkdown package

library(SASmarkdown)

set up the options so that knit knows where you SAS executable is

set the linesize to be easily readable on letter size paper, portrait

and set the knir options using opts_chunk$set().

saspath <- "C:/Program Files (x86)/SASHome/x86/SASEnterpriseGuide/7.1/SEGuide.exe"

sasopts <- "-nosplash -linesize 75 -password_on_stdin true -metauser xxxx-metapass xxxx -user_ID xxxx-password xxxx-serverusername xxxx-serverpassword xxxx"

knitr::opts_chunk$set(engine="sas", engine.path=saspath,engine.opts=sasopts, comment=NA)

run these commands to convince yourself that

within this knitr session the engine changed.

knitr::opts_chunk$get()$engine

knitr::opts_chunk$get()$engine.path

knitr::opts_chunk$get()$engine.opts

proc means data=sashelp.class;
run;

data null;

put 'Hello, world!';

run;

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/SASmarkdown/issues/15, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBMEZKUUER26L3D7KXXYTTB6WRXANCNFSM4YTRDBJQ.