Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: SAS  |  size: 0.66 KB  |  views: 159  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.    data test;
  2.     input name ~ &  $15.;
  3.     datalines;
  4.     100% BLO
  5.     100% COLOR
  6.     AVON & RAGOBERT
  7.     BALLANTINE'S
  8.    L'OREAL
  9.     AT&T
  10.     U-V-A
  11.     ;
  12.     run;
  13.  
  14.     %macro name_modal();
  15.     /*Create macro variables which contain the modalities of variables*/
  16.         %do i=1 %to 4;
  17.         data _null_;
  18.             set  test;
  19.             call symputx('num_Mod1',_N_,"G");
  20.             call symputx('tableb'||compress(put(&i,4.))||'modal'||compress(put(_N_,4.)),name,"G");
  21.         run;
  22.     %end;
  23.  
  24.        %do i=1 %to 4;
  25.         %do j=1 %to 7;
  26.             %put %superq(tableb&i.modal&j);
  27.         %end;
  28.            %end;
  29.     %mend name_modal;
  30.     %name_modal();
clone this paste RAW Paste Data