BookmarkSubscribeRSS Feed
Liane
Calcite | Level 5
8674
8675
8676
8677   %let datainicial=resultados_3;
8678   %let datafinal=resultados_4;
8679   /**********************************/
8680   data teste;
8681   set trata.&datainicial;

8686
8687   run;

NOTE: There were 821 observations read from the data set TRATA.RESULTADOS_3.
NOTE: The data set WORK.TESTE has 817 observations and 1278 variables.
NOTE: DATA statement used (Total process time):
      real time           0.16 seconds
      cpu time            0.03 seconds


8688
8689   data teste_;
8690   set teste;
8691   options mlogic mprint symbolgen;
8692   %macro oiif(x);
8693
8694   OI_&x._IEA_original=OI_&x._IEA;
8695
8696
8697   if (OI_&x. eq 1 and OI_&x._IEA eq . and NOVO_SCRIPT eq 0) then do;
8698
8699   if (oI_&x._t1_iea=3 OR oI_&x._t2_iea=3 OR oI_&x._t3_iea=3 OR oI_&x._t4_iea eq 3 OR
8699 ! oI_&x._t5_iea eq 3 OR oI_&x._t6_iea  eq 3 or oI_&x._t7_iea eq 3 or oI_&x._t8_iea  eq 3)
8699 ! then  do; OI_&x._IEA eq 3;
8700   end;else do;
8701   if (
8702   (oI_&x._t1_iea eq 1 or oI_&x._t3_iea eq 1 or oI_&x._t4_iea eq 1 or oI_&x._t5_iea eq 1 or
8702 ! oI_&x._t6_iea eq 1 or oI_&x._t7_iea eq 1 or oI_&x._t8_iea eq 1)
8703   and
8704   (oI_&x._t1_iea not in (2,3) and oI_&x._t3_iea not in (2,3) and oI_&x._t4_iea not in (2,3)
8704 ! and oI_&x._t5_iea not in (2,3) and oI_&x._t6_iea not in (2,3) and oI_&x._t7_iea not in
8704 ! (2,3) and oI_&x._t8_iea not in (2,3)))
8705   then do; OI_&x._IEA = 1;end;
8706   end;
8707
8708   if (OI_&x._t1_iea IN (2,4) and oI_&x._t3_iea  eq 2 and oI_&x._t4_iea  eq 2 and
8708 ! oI_&x._t5_iea in (2,4)
8709   and oI_&x._t6_iea in (2,4) and oI_&x._t7_iea  eq 2 and oI_&x._t8_iea  eq 2) then  do;
8709 ! OI_&x._IEA eq 2;end;
8710
8711   end;
8712
8713
8714   %mend;
8715
8716   %oiif(1);;%oiif(2);%oiif(3);%oiif(4);%oiif(5);%oiif(6);%oiif(7);%oiif(8);
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   OI_1_IEA_original=OI_1_IEA;
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   if (OI_1 eq 1 and OI_1_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   if (oI_1_t1_iea=3 OR oI_1_t2_iea=3 OR oI_1_t3_iea=3 OR oI_1_t4_iea eq 3 OR
oI_1_t5_iea eq 3 OR oI_1_t6_iea eq 3 or oI_1_t7_iea eq 3 or oI_1_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 1
NOTE: Line generated by the macro variable "X".
1       OI_1_IEA
        --------
        180
MPRINT(OIIF):   OI_1_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   if ( (oI_1_t1_iea eq 1 or oI_1_t3_iea eq 1 or oI_1_t4_iea eq 1 or oI_1_t5_iea eq
1 or oI_1_t6_iea eq 1 or oI_1_t7_iea eq 1 or oI_1_t8_iea eq 1) and (oI_1_t1_iea not in (2,3) and
oI_1_t3_iea not in (2,3) and oI_1_t4_iea not in (2,3) and oI_1_t5_iea not in (2,3) and
oI_1_t6_iea not in (2,3) and oI_1_t7_iea not in (2,3) and oI_1_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   OI_1_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
SYMBOLGEN:  Macro variable X resolves to 1
MPRINT(OIIF):   if (OI_1_t1_iea IN (2,4) and oI_1_t3_iea eq 2 and oI_1_t4_iea eq 2 and
oI_1_t5_iea in (2,4) and oI_1_t6_iea in (2,4) and oI_1_t7_iea eq 2 and oI_1_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 1
NOTE: Line generated by the macro variable "X".
1       OI_1_IEA
        --------
        180
MPRINT(OIIF):   OI_1_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):  OI_2_IEA_original=OI_2_IEA;
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):   if (OI_2 eq 1 and OI_2_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):   if (oI_2_t1_iea=3 OR oI_2_t2_iea=3 OR oI_2_t3_iea=3 OR oI_2_t4_iea eq 3 OR
oI_2_t5_iea eq 3 OR oI_2_t6_iea eq 3 or oI_2_t7_iea eq 3 or oI_2_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 2
NOTE: Line generated by the macro variable "X".
1       OI_2_IEA
        --------
        180
MPRINT(OIIF):   OI_2_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):   if ( (oI_2_t1_iea eq 1 or oI_2_t3_iea eq 1 or oI_2_t4_iea eq 1 or oI_2_t5_iea eq
1 or oI_2_t6_iea eq 1 or oI_2_t7_iea eq 1 or oI_2_t8_iea eq 1) and (oI_2_t1_iea not in (2,3) and
oI_2_t3_iea not in (2,3) and oI_2_t4_iea not in (2,3) and oI_2_t5_iea not in (2,3) and
oI_2_t6_iea not in (2,3) and oI_2_t7_iea not in (2,3) and oI_2_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):   OI_2_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
SYMBOLGEN:  Macro variable X resolves to 2
MPRINT(OIIF):   if (OI_2_t1_iea IN (2,4) and oI_2_t3_iea eq 2 and oI_2_t4_iea eq 2 and
oI_2_t5_iea in (2,4) and oI_2_t6_iea in (2,4) and oI_2_t7_iea eq 2 and oI_2_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 2
NOTE: Line generated by the macro variable "X".
1       OI_2_IEA
        --------
        180
MPRINT(OIIF):   OI_2_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):  OI_3_IEA_original=OI_3_IEA;
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):   if (OI_3 eq 1 and OI_3_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):   if (oI_3_t1_iea=3 OR oI_3_t2_iea=3 OR oI_3_t3_iea=3 OR oI_3_t4_iea eq 3 OR
oI_3_t5_iea eq 3 OR oI_3_t6_iea eq 3 or oI_3_t7_iea eq 3 or oI_3_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 3
NOTE: Line generated by the macro variable "X".
1       OI_3_IEA
        --------
        180
MPRINT(OIIF):   OI_3_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):   if ( (oI_3_t1_iea eq 1 or oI_3_t3_iea eq 1 or oI_3_t4_iea eq 1 or oI_3_t5_iea eq
1 or oI_3_t6_iea eq 1 or oI_3_t7_iea eq 1 or oI_3_t8_iea eq 1) and (oI_3_t1_iea not in (2,3) and
oI_3_t3_iea not in (2,3) and oI_3_t4_iea not in (2,3) and oI_3_t5_iea not in (2,3) and
oI_3_t6_iea not in (2,3) and oI_3_t7_iea not in (2,3) and oI_3_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):   OI_3_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
SYMBOLGEN:  Macro variable X resolves to 3
MPRINT(OIIF):   if (OI_3_t1_iea IN (2,4) and oI_3_t3_iea eq 2 and oI_3_t4_iea eq 2 and
oI_3_t5_iea in (2,4) and oI_3_t6_iea in (2,4) and oI_3_t7_iea eq 2 and oI_3_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 3
NOTE: Line generated by the macro variable "X".
1       OI_3_IEA
        --------
        180
MPRINT(OIIF):   OI_3_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):  OI_4_IEA_original=OI_4_IEA;
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):   if (OI_4 eq 1 and OI_4_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):   if (oI_4_t1_iea=3 OR oI_4_t2_iea=3 OR oI_4_t3_iea=3 OR oI_4_t4_iea eq 3 OR
oI_4_t5_iea eq 3 OR oI_4_t6_iea eq 3 or oI_4_t7_iea eq 3 or oI_4_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 4
NOTE: Line generated by the macro variable "X".
1       OI_4_IEA
        --------
        180
MPRINT(OIIF):   OI_4_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):   if ( (oI_4_t1_iea eq 1 or oI_4_t3_iea eq 1 or oI_4_t4_iea eq 1 or oI_4_t5_iea eq
1 or oI_4_t6_iea eq 1 or oI_4_t7_iea eq 1 or oI_4_t8_iea eq 1) and (oI_4_t1_iea not in (2,3) and
oI_4_t3_iea not in (2,3) and oI_4_t4_iea not in (2,3) and oI_4_t5_iea not in (2,3) and
oI_4_t6_iea not in (2,3) and oI_4_t7_iea not in (2,3) and oI_4_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):   OI_4_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
SYMBOLGEN:  Macro variable X resolves to 4
MPRINT(OIIF):   if (OI_4_t1_iea IN (2,4) and oI_4_t3_iea eq 2 and oI_4_t4_iea eq 2 and
oI_4_t5_iea in (2,4) and oI_4_t6_iea in (2,4) and oI_4_t7_iea eq 2 and oI_4_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 4
NOTE: Line generated by the macro variable "X".
1       OI_4_IEA
        --------
        180
MPRINT(OIIF):   OI_4_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):  OI_5_IEA_original=OI_5_IEA;
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):   if (OI_5 eq 1 and OI_5_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):   if (oI_5_t1_iea=3 OR oI_5_t2_iea=3 OR oI_5_t3_iea=3 OR oI_5_t4_iea eq 3 OR
oI_5_t5_iea eq 3 OR oI_5_t6_iea eq 3 or oI_5_t7_iea eq 3 or oI_5_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 5
NOTE: Line generated by the macro variable "X".
1       OI_5_IEA
        --------
        180
MPRINT(OIIF):   OI_5_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):   if ( (oI_5_t1_iea eq 1 or oI_5_t3_iea eq 1 or oI_5_t4_iea eq 1 or oI_5_t5_iea eq
1 or oI_5_t6_iea eq 1 or oI_5_t7_iea eq 1 or oI_5_t8_iea eq 1) and (oI_5_t1_iea not in (2,3) and
oI_5_t3_iea not in (2,3) and oI_5_t4_iea not in (2,3) and oI_5_t5_iea not in (2,3) and
oI_5_t6_iea not in (2,3) and oI_5_t7_iea not in (2,3) and oI_5_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):   OI_5_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
SYMBOLGEN:  Macro variable X resolves to 5
MPRINT(OIIF):   if (OI_5_t1_iea IN (2,4) and oI_5_t3_iea eq 2 and oI_5_t4_iea eq 2 and
oI_5_t5_iea in (2,4) and oI_5_t6_iea in (2,4) and oI_5_t7_iea eq 2 and oI_5_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 5
NOTE: Line generated by the macro variable "X".
1       OI_5_IEA
        --------
        180
MPRINT(OIIF):   OI_5_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):  OI_6_IEA_original=OI_6_IEA;
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):   if (OI_6 eq 1 and OI_6_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):   if (oI_6_t1_iea=3 OR oI_6_t2_iea=3 OR oI_6_t3_iea=3 OR oI_6_t4_iea eq 3 OR
oI_6_t5_iea eq 3 OR oI_6_t6_iea eq 3 or oI_6_t7_iea eq 3 or oI_6_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 6
NOTE: Line generated by the macro variable "X".
1       OI_6_IEA
        --------
        180
MPRINT(OIIF):   OI_6_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):   if ( (oI_6_t1_iea eq 1 or oI_6_t3_iea eq 1 or oI_6_t4_iea eq 1 or oI_6_t5_iea eq
1 or oI_6_t6_iea eq 1 or oI_6_t7_iea eq 1 or oI_6_t8_iea eq 1) and (oI_6_t1_iea not in (2,3) and
oI_6_t3_iea not in (2,3) and oI_6_t4_iea not in (2,3) and oI_6_t5_iea not in (2,3) and
oI_6_t6_iea not in (2,3) and oI_6_t7_iea not in (2,3) and oI_6_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):   OI_6_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
SYMBOLGEN:  Macro variable X resolves to 6
MPRINT(OIIF):   if (OI_6_t1_iea IN (2,4) and oI_6_t3_iea eq 2 and oI_6_t4_iea eq 2 and
oI_6_t5_iea in (2,4) and oI_6_t6_iea in (2,4) and oI_6_t7_iea eq 2 and oI_6_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 6
NOTE: Line generated by the macro variable "X".
1       OI_6_IEA
        --------
        180
MPRINT(OIIF):   OI_6_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):  OI_7_IEA_original=OI_7_IEA;
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):   if (OI_7 eq 1 and OI_7_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):   if (oI_7_t1_iea=3 OR oI_7_t2_iea=3 OR oI_7_t3_iea=3 OR oI_7_t4_iea eq 3 OR
oI_7_t5_iea eq 3 OR oI_7_t6_iea eq 3 or oI_7_t7_iea eq 3 or oI_7_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 7
NOTE: Line generated by the macro variable "X".
1       OI_7_IEA
        --------
        180
MPRINT(OIIF):   OI_7_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):   if ( (oI_7_t1_iea eq 1 or oI_7_t3_iea eq 1 or oI_7_t4_iea eq 1 or oI_7_t5_iea eq
1 or oI_7_t6_iea eq 1 or oI_7_t7_iea eq 1 or oI_7_t8_iea eq 1) and (oI_7_t1_iea not in (2,3) and
oI_7_t3_iea not in (2,3) and oI_7_t4_iea not in (2,3) and oI_7_t5_iea not in (2,3) and
oI_7_t6_iea not in (2,3) and oI_7_t7_iea not in (2,3) and oI_7_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):   OI_7_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
SYMBOLGEN:  Macro variable X resolves to 7
MPRINT(OIIF):   if (OI_7_t1_iea IN (2,4) and oI_7_t3_iea eq 2 and oI_7_t4_iea eq 2 and
oI_7_t5_iea in (2,4) and oI_7_t6_iea in (2,4) and oI_7_t7_iea eq 2 and oI_7_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 7
NOTE: Line generated by the macro variable "X".
1       OI_7_IEA
        --------
        180
MPRINT(OIIF):   OI_7_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
MLOGIC(OIIF):  Beginning execution.
MLOGIC(OIIF):  Parameter X has value 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):  OI_8_IEA_original=OI_8_IEA;
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):   if (OI_8 eq 1 and OI_8_IEA eq . and NOVO_SCRIPT eq 0) then do;
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):   if (oI_8_t1_iea=3 OR oI_8_t2_iea=3 OR oI_8_t3_iea=3 OR oI_8_t4_iea eq 3 OR
oI_8_t5_iea eq 3 OR oI_8_t6_iea eq 3 or oI_8_t7_iea eq 3 or oI_8_t8_iea eq 3) then do;
SYMBOLGEN:  Macro variable X resolves to 8
NOTE: Line generated by the macro variable "X".
1       OI_8_IEA
        --------
        180
MPRINT(OIIF):   OI_8_IEA eq 3;
MPRINT(OIIF):   end;
MPRINT(OIIF):  else do;
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):   if ( (oI_8_t1_iea eq 1 or oI_8_t3_iea eq 1 or oI_8_t4_iea eq 1 or oI_8_t5_iea eq
1 or oI_8_t6_iea eq 1 or oI_8_t7_iea eq 1 or oI_8_t8_iea eq 1) and (oI_8_t1_iea not in (2,3) and
oI_8_t3_iea not in (2,3) and oI_8_t4_iea not in (2,3) and oI_8_t5_iea not in (2,3) and
oI_8_t6_iea not in (2,3) and oI_8_t7_iea not in (2,3) and oI_8_t8_iea not in (2,3))) then do;
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):   OI_8_IEA = 1;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
SYMBOLGEN:  Macro variable X resolves to 8
MPRINT(OIIF):   if (OI_8_t1_iea IN (2,4) and oI_8_t3_iea eq 2 and oI_8_t4_iea eq 2 and
oI_8_t5_iea in (2,4) and oI_8_t6_iea in (2,4) and oI_8_t7_iea eq 2 and oI_8_t8_iea eq 2) then do;
SYMBOLGEN:  Macro variable X resolves to 8
NOTE: Line generated by the macro variable "X".
1       OI_8_IEA
        --------
        180
MPRINT(OIIF):   OI_8_IEA eq 2;
MPRINT(OIIF):  end;
MPRINT(OIIF):   end;
MLOGIC(OIIF):  Ending execution.
ERROR 180-322: Statement is not valid or it is used out of proper order.

8717
8718
8719   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TESTE_ may be incomplete.  When this step was stopped there were 0
         observations and 1291 variables.
WARNING: Data set WORK.TESTE_ was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.59 seconds
      cpu time            0.15 seconds
data teste_; set teste; %macro oiif(x); OI_&x._IEA_original=OI_&x._IEA; if (OI_&x. eq 1 and OI_&x._IEA eq . and NOVO_SCRIPT eq 0) then do; if (oI_&x._t1_iea=3 OR oI_&x._t2_iea=3 OR oI_&x._t3_iea=3 OR oI_&x._t4_iea eq 3 OR oI_&x._t5_iea eq 3 OR oI_&x._t6_iea eq 3 or oI_&x._t7_iea eq 3 or oI_&x._t8_iea eq 3) then do; OI_&x._IEA eq 3; end;else do; if ( (oI_&x._t1_iea eq 1 or oI_&x._t3_iea eq 1 or oI_&x._t4_iea eq 1 or oI_&x._t5_iea eq 1 or oI_&x._t6_iea eq 1 or oI_&x._t7_iea eq 1 or oI_&x._t8_iea eq 1) and (oI_&x._t1_iea not in (2,3) and oI_&x._t3_iea not in (2,3) and oI_&x._t4_iea not in (2,3) and oI_&x._t5_iea not in (2,3) and oI_&x._t6_iea not in (2,3) and oI_&x._t7_iea not in (2,3) and oI_&x._t8_iea not in (2,3))) then do;OI_&x._IEA = 1;end; end; if (OI_&x._t1_iea IN (2,4) and oI_&x._t3_iea eq 2 and oI_&x._t4_iea eq 2 and oI_&x._t5_iea in (2,4) and oI_&x._t6_iea in (2,4) and oI_&x._t7_iea eq 2 and oI_&x._t8_iea eq 2) then do;OI_&x._IEA eq 2;end; end; %mend; %oiif(1);;%oiif(2);%oiif(3);%oiif(4);%oiif(5);%oiif(6);%oiif(7);%oiif(8); run;

Error.pngHi.

 

When I running the macro in the code attached it gives me the following error:

"NOTE: Line generated by the macro variable "X".
1 OI_8_IEA
--------
180
ERROR 180-322: Statement is not valid or it is used out of proper order."

 

Ideas how to solve the problem?

Thank you.

5 REPLIES 5
PaigeMiller
Diamond | Level 26

It would help if you used

 

options mprint mlogic symbolgen;

at the start of your code, run it again, and then paste the ENTIRE SAS log (not just the parts with errors) as text (not as a screen capture) into the window that appears when you click on the { i } icon (do not paste the log any other way).

 

The error means you do not have valid SAS code after the macro is resolved. Beyond that, we need to see the log.

--
Paige Miller
Liane
Calcite | Level 5

Thank you. 

Post updated with ENTIRE SAS log.

 

Kurt_Bremser
Super User

Rule #1 for building macros: start with working Base SAS code.

Right now, you create invalid SAS code becasue you start with invalid SAS code. As mentioned earlier, this statement

OI_&x._IEA eq 3;

is invalid SAS code, you must use

OI_&x._IEA = 3;

The mnemonic eq is a comparison operator and can only be used in conditions; it is not valid as an assigment operator, there you MUST use the equal sign ONLY.

Kurt_Bremser
Super User

This

OI_&x._IEA eq 3;

can never resolve to a valid SAS statement. The eq mnemonic can only be used in comparisons, not in assignments.

 

Use

options mlogic mprint symbolgen;

for debugging macro code.

gamotte
Rhodochrosite | Level 12

Hello,

 

Your tests are difficult to read and thus prone to mistakes. For instance, is oI_&x._t2_iea missing on purpose

or is it a copy/paste error ? By using arrays, you can make your code much more readable.

 

data have;
    array OI OI_1_t1-OI_1_t4;

    do _N_=1 to 100;
        do over OI;
            OI=floor(4*rand("Uniform")+1);
        end;
        output;
    end;
run;

data want;
    set have;
    array OI OI:;

    if 2 in OI or 4 in OI then OI_1=2;
    else if 3 in OI then OI_1=3;
    else OI_1=1;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2749 views
  • 0 likes
  • 4 in conversation