BookmarkSubscribeRSS Feed
JohnRivers10
Calcite | Level 5

Hello SAS Community,

 

With the following code:

 

clear all;
proc import
datafile='C:\Users\Shaft\Documents\France_2015_2016\M2_ETE\Master_Thesis\matthes.csv'
out=work.matthes
dbms=csv
replace;
getnames=yes;
datarow=2;
run;
data matthes2;
set matthes;

date_num=datepart(date);
format date_part yyq6.;
date_char = put(date_num, yyq6.);
run;

ods tagsets.colorlatex file="C:\Users\Shaft\Documents\France_2015_2016\M2_ETE\Master_Thesis\simps1.tex" stylesheet="sas.sty"(url="sas")
title = "Fishers Z: Interest Rate and Output Gap (After Volker)";
proc corr data=matthes2 fisher(rho0=.99) fisher(type=upper);
where date_char ge '1979Q4';
var i y;
run;
ods tagsets.colorlatex close;

 

I get a Tex file output that looks like this when compiled:

 

sasexample.png

 

I don't get any errors when I copile in Texmaker, so I'm tempted to think this is a SAS question rather than a LaTeX one.

 

Any tips? I'm very open to proposal to drastically change my code. I'm very new to this. Just trying to get basic tables to go into LaTeX from SAS.

 

Thanks so much.

 

John

3 REPLIES 3
Reeza
Super User

Well the table does appear too wide to fit on the page. 

Can your change the orientation?

 

options orientation=landscape;
JohnRivers10
Calcite | Level 5

Hey again Reeza -- thanks as always for your help.

 

Even with this, the table is just too big. The one thing I was able to do was to change a few words ("Corr" instead of "Correlation") to make the columns skinnier. I guess I would have thought there would be a different way to do this 😕

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, your output from SAS is markup, so its down to the renderer to decide how the output looks.  Personally I would always store the objects created by a proc, and then report them out both to keep the data (for validation) but also so you have the full flexibility of proc report to design a nice output - I have never seen a situation where the default output is as I would like.

ods trace on;
proc corr...;
run;
ods trace off;

You will see in the log all the objects which are created, you can them save these and proc report them:

ods output <objectname>=<datasetname>;

proc corr...;
run;

ods tagsets...
proc report data=<datasetname>...
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2094 views
  • 0 likes
  • 3 in conversation