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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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