BookmarkSubscribeRSS Feed
NCNyrk
Calcite | Level 5
1 When using the Split='/' option in Proc Print, the resulting cell in Excel has been height adjusted as if it knows there are two lines, but instead of splitting the text, it is all on one line with a non-printing character on screen. If I double click the cell, it splits the lines, but I obviously don't want to do that.

2 With multiple titles, a blank line is inserted between each title in the Header section of the spreadsheet (undesired). Then, no blank lines between the 2nd title and the headers (would prefer blank line). Tried to use the Skip_Space option, but that didn't help.

TIA for any assistance...I'm getting *so* close!
9 REPLIES 9
Kathryn_SAS
SAS Employee
The updated tagset should take care of both of these issues for you. You can download it from here:

http://support.sas.com/rnd/base/topics/odsmarkup/
NCNyrk
Calcite | Level 5
Sorry, I should have specified that I am using the latest Tagset from June 2006.
Kathryn_SAS
SAS Employee
The following sample code worked for me. The label is split appropriately. The TITLEs do not have blank lines in between and there is a blank line between TITLE2 and the beginning of the table.

ods listing close;
ods tagsets.excelxp file='test.xls'
options(embedded_titles='yes');

proc print data=sashelp.class noobs split='/';
title1 'one';
title2 'two';
label age='Age in/years';
run;

ods listing;
ods tagsets.excelxp close;

If you continue to have problems, I would suggest opening a tracking entry with Technical Support by sending your log and a sample of the output to support@sas.com.
NCNyrk
Calcite | Level 5
Thanks for the code; I was able to get the split labels working, but the problem with the titles is actually in the Header Section. (using the default behavior of "embedded_titles='no'" to force the title statements to appear in the Header section of Excel).

It looks like two hard returns are inserted between each title statement, and if there are more than 2 titles, the data overwrites the third title statement.

I tried to use the Print_Header command, but it didn't work for me.
Eric_SAS
SAS Employee
There was actually only one newline at the end of each title. But Excel was interpreting it as a double space.
replacing the newline with an causes the spacing to go away. I have an updated tagset that will be available on the web soon.

if you want to try it yourself, look for the title_data event in the tagset. Case insensitive earch for
"event title_data". This is what it looks like.
Sorry I couldn't get the indention to take.

define event title_data;

do /if $not_first;
put nl;
else;
putq " ss:StyleID=" lowcase(htmlclass);
putq ' Data="';
done;

Change the nl in the put to an " ";


define event title_data;

do /if $not_first;
put " ";
else;
putq " ss:StyleID=" lowcase(htmlclass);
putq ' Data="';
done;
David_SAS
SAS Employee
If you want to preserve indentation in SAS code, use the PRE and /PRE tags (enclosed in square brackets. Without PRE you have:

proc tabulate data=sashelp.class;
class sex age;
var height;
table sex,age*height;
run;

With PRE you have:

[pre]
proc tabulate data=sashelp.class;
class sex age;
var height;
table sex,age*height;
run;
[/pre]

-- David Kelley, SAS
NCNyrk
Calcite | Level 5
Thanks...I modified my template, and it worked as desired.

One last spacing issue...I have 3 Title Statements, and I would like a blank like between the Header (the 3rd Title) and the Body of the Report.

Is this something I can do via in-line formatting (perhaps a well-placed " " in my code?) or will it require a tweak to the actual template?
Eric_SAS
SAS Employee
Just add a blank title4.

title4 ' ';
NCNyrk
Calcite | Level 5
It looks like 3 is the maximum number of titles that will fit in the header, so

title4 ' ';

does not do anything. I reconfigured the titles into two lines, and then used

title3 ' ';

successfully.

Thanks!

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
  • 9 replies
  • 1397 views
  • 0 likes
  • 4 in conversation