Tuesday, March 11, 2014

SAS- Loop



SAS PROGRAMS FOR ABSOLUTE BEGINNERS BY AJEET KUMAR


/* Loop Program Number: 1 */
data ;
do;
height=0;
end;
run;
proc print ;
run;

/* Loop Program Number: 2 */
data ;
do index=1 to 10;
height=index;
end;
run;
proc print ;
run;

/* Loop Program Number: 3 */
data ;
do loop_counter=1 to 10;
counter+1;
end;
run;
proc print ;
run;

/* Loop Program Number: 4 */
data matrix;
do i = 1 to 3;
      do j = 1 to 2;
      put i j;
      end;
end;
run;

/* Loop Program Number: 5 */
data matrix;
do i = 1 to 3;
      do  j= 1 to 2;
      file "d:\sonam.txt";
      put i= j=;
      end;
end;
run;

/* Loop Program Number: 6 */
data matrix;
do i = 1 to 3;
      do  j= 1 to 2;
      file print;
      put i= j=;
      end;
end;
run;

/* Loop Program Number: 7 */
options ls=90 ps=89 nodate nonumber center;
title;
data matrix;
do i = 1 to 3;
      do  j= 1 to 2;
      file print;
      put i= j= _all_;
      end;
end;
run;

No comments:

Post a Comment

Hot Topics