user2146441
user2146441

Reputation: 228

Create classdata for PROC TABULATE

The following code creates 15 rows of CLASSDATA I need for a PROC TABULATE command.

    proc sql; create table foo(eventtime num,node char(100)); quit;
    proc sql;  insert into foo (eventtime, node)                                                                                         
    values(1, '')
    values(2, 'L')
    values(2, 'W')
    values(3, 'LL')
    values(3, "LW/WL")
    values(3, 'WW')
    values(4, 'LLL')
    values(4, "LLW/LW*")
    values(4, "WL*/WWL")
    values(4, 'WWW')
    values(5, 'LLLL')
    values(5, "LLLW/LLW*/LWLL")
    values(5, "LWLW/LWW*/WLL*/WLWL")
    values(5, "WLWW/WWL*/WWWL")
    values(5, 'WWWW');                                                                                                                                                                                                         
quit; 

How can I edit the code to create two new entries at each row level of 'YES' AND 'NO' and then four further entries at each of those rows for the following four options 50, 100, 150, 200? In total, that will be 120 rows.

Upvotes: 0

Views: 270

Answers (1)

Dmitry Shopin
Dmitry Shopin

Reputation: 1763

If I got it right, you need to add after your two PROC SQLs something like this:

data foo120;
  set foo;
  do NewVar1='YES','NO';
    do NeVar2=50 to 200 by 50;
      output;
    end;
  end;
run;

Upvotes: 1

Related Questions