1605 data eq;
1606 input ID y x z w;
1607 cards;
NOTE: The data set WORK.EQ has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
1612 ;
1613 run;
1614
1615 %macro tem (missper,n_imp,n_seed);
1616 %PUT proc mi data=eq seed=&&my_seed&i nimpute=&n_imp out=EMIMP&missper;
1617 em itprint outem = outem;
1618 var y x z w;
1619 run;
1620 %mend tem;
1621
1622 %macro mi (missper,n_imp,n_seed);
1623 %tem (&missper,&n_imp,&n_seed);
1624 %mend mi;
1625
1626 %macro large(missper,n_imp,n_seed,n_boot);
1627 data seed_long(drop=i);
1628 call streaminit(&n_seed);
1629 do i = 1 to &n_boot;
1630 x_seed = floor(rand("Uniform")*500000); output;
1631 end;
1632 run;
1633
1634 data _null_;
1635 set seed_long;
1636 call symput('my_seed'|| compress(put(_n_,4.)), x_seed);
1637 run;
1638
1639 %let i=1;
1640 %do %until (&i>&n_boot) ;
1641 %mi(&missper,&n_imp,&n_seed);
1642 %let i = %eval(&i+1);
1643 %end;
1644 %mend large;
1645
1646 %large(20,5,3456,3);
MPRINT(LARGE): data seed_long(drop=i);
MPRINT(LARGE): call streaminit(3456);
MPRINT(LARGE): do i = 1 to 3;
MPRINT(LARGE): x_seed = floor(rand("Uniform")*500000);
MPRINT(LARGE): output;
MPRINT(LARGE): end;
MPRINT(LARGE): run;
NOTE: The data set WORK.SEED_LONG has 3 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
MPRINT(LARGE): data _null_;
MPRINT(LARGE): set seed_long;
MPRINT(LARGE): call symput('my_seed'|| compress(put(_n_,4.)), x_seed);
MPRINT(LARGE): run;
NOTE: Numeric values have been converted to character values at the places given by:
(Line):(Column).
5893:233
NOTE: There were 3 observations read from the data set WORK.SEED_LONG.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
proc mi data=eq seed= 95419 nimpute=5 out=EMIMP20
NOTE: Line generated by the invoked macro "TEM".
1 em itprint outem = outem;
--
180
MPRINT(TEM): em itprint outem = outem;
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: Line generated by the invoked macro "TEM".
1 var y x z w;
---
180
MPRINT(TEM): var y x z w;
ERROR 180-322: Statement is not valid or it is used out of proper order.
MPRINT(TEM): run;
MPRINT(MI): ;
MPRINT(LARGE): ;
proc mi data=eq seed= 450752 nimpute=5 out=EMIMP20
NOTE: Line generated by the invoked macro "TEM".
1 em itprint outem = outem;
--
180
MPRINT(TEM): em itprint outem = outem;
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: Line generated by the invoked macro "TEM".
1 var y x z w;
---
180
MPRINT(TEM): var y x z w;
ERROR 180-322: Statement is not valid or it is used out of proper order.
MPRINT(TEM): run;
MPRINT(MI): ;
MPRINT(LARGE): ;
proc mi data=eq seed= 436565 nimpute=5 out=EMIMP20
NOTE: Line generated by the invoked macro "TEM".
1 em itprint outem = outem;
--
180
MPRINT(TEM): em itprint outem = outem;
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: Line generated by the invoked macro "TEM".
1 var y x z w;
---
180
MPRINT(TEM): var y x z w;
ERROR 180-322: Statement is not valid or it is used out of proper order.
MPRINT(TEM): run;
MPRINT(MI): ;
MPRINT(LARGE): ;
Thanks for your suggestion. I don't know where is the 1 coming from. I am using sas for student. I can't find a strange character now.
... View more