New Contributor
Posts: 3

# Setting directories in tex-files for use with statrep

I have tried to find an easy way to integrate SAS code and output in my latex documents. I have tried to install and use the Statrep package from http://support.sas.com/rnd/app/papers/statrep.html, but can't get it to work properly. I thus have a few questions. Several attempts have left me quite frustrated, and any help will be greatly appreciated.

I believe the problem has to do with sending output to and retrieving it from correct folders. I need all files to be on a network drive (\\fil-tjener\) separate from the SAS-server (d:\). The SAS-server is not accessible from file explorers or any other programs besides SAS/EG.

I would like to use these folders:
Tex-files: \\fil-tjener\Texfile
SAS-output: \\fil-tjener\Texfile\SASoutput
SAS-macros and templates: \\fil-tjener\statrep

I tried the quickstart.tex-file included in the package. It compiles (pdflatex) just fine the first time. quickstart_SR.sas and quickstart_SR_preamble.sas is generated as they should be, in \\fil-tjener\Texfile.

quickstart_SR.sas will not run as is, but if I change

%include "./quickstart_SR_preamble.sas" /nosource;
to
%include "\\fil-tjener\Texfile\quickstart_SR_preamble.sas" /nosource;
it finds the preamblefile and runs it.

Question 1: How do I modify the tex-file so that I don't need to manually change the SAS-file to get SAS to look for the preamble file in my designated folder?

It does produce an error because it is looking for the SAS macro file in the wrong directory. If I change the %include-statemtent in the preamble-file to
%include "\\fil-tjener\statrep\statrep_macros.sas" /nosource;
it does find the file containing the macros. quickstart_SR.sas will now run without errors.

Question 2: How do I modify the tex-file to have it look for statrep_macros.sas in my chosen directory?

While it seems runs just fine, the output is nowhere to be found. Thus figures are still missing on the second tex-compilation. The log has lines like NOTE: Writing Graph file: ./png/tstb.png
It seems output is sent to to the work directory on the SAS server instead of my chosen folder on the network drive.

Question 3: How do I modify the tex-file so that the SAS-ouput is sent to \\fil-tjener\Texfile\SASoutput?

Question 4: How do I modify the tex-file so that the SAS-ouput is retrieved from  \\fil-tjener\Texfile\SASoutput on the second pdflatex compilation?

Operating system, SAS-server: WX64_SV
Operating system, my computer: Windows 7 Enterprise.
SAS-version: 9.4_M2
Latex: Texmaker/Miktex

New Contributor
Posts: 3

## Re: Setting directories in tex-files for use with statrep

Never mind, I've got it working now. It's funny how some times phrasing a question helps clarify the issue enough for one to find the answer by oneself.

I had to include the following in the preamble of the tex-file:

\def\SRrootdir{//fil-tjener/texfile}
\def\SRmacropath{//fil-tjener/statrep/statrep_macros.sas}


(note the slashes)

Discussion Stats