BookmarkSubscribeRSS Feed
akj
Fluorite | Level 6 akj
Fluorite | Level 6

I am trying to output the results from PROC TTEST on 8 variables using ODS TAGSETS.EXCELXP.  However, the title in between the individual PROC TTESTs does not show up, making it hard to identify the individual variables.

 

ods _all_ close;

 

ods tagsets.ExcelXP path='filepath' file='filename.xml'  style=printer

     options(sheet_interval='Proc'

                  embedded_titles="yes"

                  embedded_footnotes="yes"

                  skip_space='3,0,1,1,1'

                  contents='yes');

options helpbrowser=sas;

 

ods tagsets.ExcelXP options(sheet_name='sheet1');

proc ttest data=data1;

class var1;

var var2 var3 var4 var5 var6 var7 var8 var9;

title 'Proc ttest';

title2 'data1';

run;

ods tagsets.ExcelXP close;

 

In the output from PROC TTEST (not ODS) the first 2 lines are:

 

The TTEST Procedure

Variable: var1

 

This does not transfer to the Excel file.  Why>

4 REPLIES 4
Reeza
Super User

1. Check your tagsets version - its in the log afte you use ODS Tagsets

2. If not the latest and greatest update it

3. If #1 fails, what version of SAS

4. Post a sample that we can run - ie use SASHELP datasets not your own data since that means I can't run it. 

akj
Fluorite | Level 6 akj
Fluorite | Level 6

The tagset is up-to-date.  I am running SAS 9.4 in a UNIX environment.  Here is the code:

 

footnote 'test ODS';

title 'Birthweight Data';

title2 'sashelp.bweight';

 

ods listing;

ods results;      

proc ttest data=sashelp.bweight;      

  class boy;      

  var weight momage momwtgain ;

run;            

 

ods _all_ close;

ods tagsets.ExcelXP path="[filepath]" file="BWEIGHT_test.xml" style=printer                  

        options(sheet_interval='Proc'                                                

                    embedded_titles="yes"                                                

                    embedded_footnotes="yes"                                                

                    skip_space='3,0,1,1,1'                                                

                    contents="yes");

options helpbrowser=sas;            

 

ods tagsets.ExcelXP options(sheet_name='Weight');            

   proc ttest data=sashelp.bweight;                  

      class boy;                  

      var weight momage momwtgain ;            

   run;            

ods tagsets.ExcelXP close;  

 

I have attached the output of the first PROC TTEST as a txt file and the EXCEL output as a PDF.

SuzanneDorinski
Lapis Lazuli | Level 10

If you are using SAS 9.4 maintenance release 3 or maintenance release 4, you can use ODS EXCEL instead.  

 

The text showing the variable name and label shows up in ODS EXCEL.  But the text wrap and merge and center are different for the first variable and the remaining variables in the spreadsheet.  I tried the nocenter option in the SAS code, but that didn't help.

 

The screen shots below show that the text for the weight variable is easy to read, but the text for momage and for momwtgain are in the cell, but you cannot read the full text  unless you put your cursor in that cell.  

 

For tagsets.ExcelXP, I tried adding merge_titles_footnotes='yes' and title_footnote_width='8' as options, but still didn't get the lines for weight, momage, or momwtgain.  

 

I'd suggest emailing your question to ods@sas.com.  

 

PROC TTEST output for weight variable has text indicating variable name and label.jpg

 

Second variable in PROC TTEST output has variable name and label in ODS EXCEL.jpg

 

Third variable in PROC TTEST output has variable name and label text.jpg

Sticky
Fluorite | Level 6

The results in M7 are worse. It now produces a separate sheet for every table but has the first variable as the title to every table. Very confusing to read.

R

 

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
  • 4 replies
  • 1572 views
  • 2 likes
  • 4 in conversation