Help using Base SAS procedures

proc tabulate pctn

Reply
Contributor L_L
Contributor
Posts: 56

proc tabulate pctn

Dear all

I'm trying
to create a macro who starts from proc tabulate output.

Ex:

proc tabulate data=sasdata out=dboutput;

class var1 var2 var3 var4  varby;

table (var1 var2 var3 var4),

   (varby=' ' all=' ')*(n=’ ‘ colpctn=’ ‘);

run;

data dboutput;

set dboutput;

COLP=PCTN_00001;

  if PCTN_00001=. then COLP =PCTN_00000;

run;

The proc tabulate output dataset contains the variables PCTN_00001 and PCTN_00000.

If I put five variables in proc tabulate in the output dataset I’ll have PCTN_000001 and PCTN_000000.

So adding (or subtracting) other variables, the variable name would change.

I’m not able to manage it : I would like to create a macro for N variables..anyone can help me?

Tahnks in advance

Ask a Question
Discussion stats
  • 0 replies
  • 154 views
  • 0 likes
  • 1 in conversation