BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BruceBrad
Lapis Lazuli | Level 10

(Related to - but not the same as my other question on headers).

I have

data test;

input v1 v2 v3;

cards;

1 1 1

2 2 4

3 4 10

;

proc tabulate;

  class v1 v2;

  var v3;

  label v1='';  /* two single quotes */

  label v3='';

  table min*v3*v1,v2;

  run;

The output I get is in the attached screenshot. In short, I get single quotes appearing for the labels for v1 and v2. How do I remove them altogether? I'm using 9.4. (If use ' ' (a space between the quotes) the variable names appear instead. I get the same result if I use double quotes).


Capture.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data test;
input v1 v2 v3;
cards; 
1 1 1
2 2 4
3 4 10
; 
proc tabulate; 
  class v1 v2;
  var v3;
  table min*v3=' '*v1=' ',v2;
  run;

Xia Keshan

View solution in original post

8 REPLIES 8
Patrick
Opal | Level 21

Have a blank between the quotes.

BruceBrad
Lapis Lazuli | Level 10

Tried that. If I do that, I get the variable name appearing.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, funnily enough this seems to work:

data test;

input v1 v2 v3;

cards;

1 1 1

2 2 4

3 4 10

;

run;

ods escapechar "^";

proc tabulate;

  class v1 v2;

  var v3;

  label v1="^{subscript }";  /* two single quotes */

  label v3="^{superscript }";

  table min*v3*v1,v2;

run;

Not ideal I know (I personally don't use tabulate).  You could also just output to a dataset:

proc tabulate out=xyz;

...

Then use proc report to generate the output required.

data_null__
Jade | Level 19

I would use the nob-breaking space byte(160)  'a0'x  It may be output destination dependent but it seems that something with space in the name should print as "blank".


data test;
input v1 v2 v3;
cards;
1 1 1
2 2 4
3 4 10
;
proc tabulate;
 
class v1 v2;
  var v3;
  label v1='a0'x
 
label v3='a0'x;
 
table min*v3*v1,v2;
  run;
10-10-2014 6-16-48 AM.png
Ksharp
Super User
data test;
input v1 v2 v3;
cards; 
1 1 1
2 2 4
3 4 10
; 
proc tabulate; 
  class v1 v2;
  var v3;
  table min*v3=' '*v1=' ',v2;
  run;

Xia Keshan

data_null__
Jade | Level 19

Ksharp wrote:

data test;
input v1 v2 v3;
cards; 
1 1 1
2 2 4
3 4 10
; 
proc tabulate; 
  class v1 v2;
  var v3;
  table min*v3=' '*v1=' ',v2;
  run;

Xia Keshan

This should be the preferred method as it removes the "label" row produce by non-breaking space

10-10-2014 7-14-02 AM.png

ballardw
Super User

Or instead of relying on label:

proc tabulate;

  class v1 v2;

  var v3;

  table v3='' * v1='',v2*sum='';

  run;

Single quotes with no space to override. Since V3 is a VAR it want a summary statistic row header which will still appear as blank.

BruceBrad
Lapis Lazuli | Level 10

Thanks all. The responses which suggest using the within table statement =' ' formatting work (with or without the space in between). I thought I had tried this, but obviously not.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 8 replies
  • 3646 views
  • 6 likes
  • 6 in conversation