SAS

Résolu
Mathieu -  
 mathieu -
Bonjour,
Voici mon programme SAS

%macro MCALCVAR ( VAR1 = , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = );

%if &VAR1 = %then %do;
%if &VAR2 = %then %do;
%if &VAR3 = %then %do;
%if &VAR4 = %then %do;
%if &VAR5 = %then %do;
%if &VAR6 = %then %do;
%if &VAR7 = %then %do;
%if &VAR8 = %then %do;
%if &VAR9 = %then %do;
%if &VAR10 = %then %do;
%put Aucune Variable précisée;
%end;
%end;
%end;
%end;
%end;
%end;
%end;
%end;
%end;
%end;

%mend MCALCVAR;
%MCALCVAR ( VAR1 = , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = );

pourriez vous me m'aidez a faire quelque avec une boucle do
merci davance
Configuration: Windows XP
Internet Explorer 7.0

2 réponses

  1. fabien
     
    tien essaye ca

    %macro MCALCVAR ( VAR1 = , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = );

    %do i=1 %to 10;

    %if &&VAR&i = %then %do;
    %let x&i = 0;
    %end;

    %else %do;
    %let x&i = 1;
    %end;

    %put x&i = &&x&i;

    %end;

    %mend MCALCVAR;
    %MCALCVAR ( VAR1 = name , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = name );
    0
    1. mathieu
       
      ton programme nest pa complet
      0
  2. mathieu
     
    Voici ci dessous le programme g reussi a trouvé

    %macro MCALCVAR ( VAR1 = , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = );

    %do i=1 %to 10;

    %if &&VAR&i = %then %do;
    %let x&i = 0;
    %end;

    %else %do;
    %let x&i = 1;
    %end;

    %end;

    %let total = 0;

    %do i=1 %to 10;
    %let total = %eval (&total + &&x&i );
    %end;

    %if &total = 0 %then %do;
    %put Aucune Variable précisée;
    %end;

    %mend MCALCVAR;
    %MCALCVAR ( VAR1 = , VAR2 = , VAR3= , VAR4 = , VAR5 = , VAR6 = , VAR7 = , VAR8 = , VAR9 = , VAR10 = );
    0