Sep 22 , homework, footnote staqtements

7 views
Skip to first unread message

Thirumagal manivannan

unread,
Sep 24, 2014, 2:08:53 PM9/24/14
to anova...@googlegroups.com
data ae;
infile datalines;
input aedtc $9.;
datalines;
UNJAN1999
22FEB2003
UNUNK2005
UNUNK9999
;
run;


Hi Vikas,
 For Sep 22nd, adding footnote statement. I got an error message in the log

%macro impute(dsname=);
 if substr(&dsname.dtc,1,2) = "UN" then substr(&dsname.dtc,1,2) = '15';
 if substr(&dsname.dtc,3,3) = "UNK" then substr(&dsname.dtc,3,3) = 'JUL';
 if substr(&dsname.dtc,6) = "9999" then substr(&dsname.dtc,6) = '2005';
%mend;
%let systime = %sysfunc(time(),time8.0);
%let sysdate9 = %sysfunc(date(),monName9.);


data mh_impute;
 set mh;
  %impute(dsname=mh);
  footnote1 "Report produced on &sysdate9";
  footnote2 "at &systime";
run;
proc print data = mh_impute;
run;

log message

 Notes (8)

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

 42         ;

 43        

 44         data ae;

 45         infile datalines;

 46         input aedtc $9.;

 47         datalines;

 

 NOTE: The data set WORK.AE has 4 observations and 1 variables.

 NOTE: DATA statement used (Total process time):

       real time           0.01 seconds

       cpu time            0.02 seconds

      

 

 52         ;

 53         run;

 54        

 55         %macro impute(dsname=);

 56          if substr(&dsname.dtc,1,2) = "UN" then substr(&dsname.dtc,1,2) = '15';

 57          if substr(&dsname.dtc,3,3) = "UNK" then substr(&dsname.dtc,3,3) = 'JUL';

 58          if substr(&dsname.dtc,6) = "9999" then substr(&dsname.dtc,6) = '2005';

 59         %mend;

 60         %let systime = %sysfunc(time(),time8.0);

 ERROR: Attempt to assign a value to a read-only symbolic variable (SYSTIME).

 61         %let sysdate9 = %sysfunc(date(),monName9.);

 ERROR: Attempt to assign a value to a read-only symbolic variable (SYSDATE9).

 62        

 63        

 64         data mh_impute;

 65          set mh;

 66           %impute(dsname=mh);

 67           footnote1 "Report produced on &sysdate9";

 68           footnote2 "at &systime";

 69         run;

 

 NOTE: There were 4 observations read from the data set WORK.MH.

 NOTE: The data set WORK.MH_IMPUTE has 4 observations and 1 variables.

 NOTE: DATA statement used (Total process time):

       real time           0.02 seconds

       cpu time            0.02 seconds

      

 

 70         proc print data = mh_impute;

 71         run;

 

 NOTE: There were 4 observations read from the data set WORK.MH_IMPUTE.

 NOTE: The PROCEDURE PRINT printed page 1.

 NOTE: PROCEDURE PRINT used (Total process time):

       real time           0.15 seconds

       cpu time            0.17 seconds

      

 

 72        

 73         ;

 74         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

 84         ;

 

result with foot not.docx

Anova Groups

unread,
Sep 24, 2014, 5:06:26 PM9/24/14
to anova...@googlegroups.com
SYSTIME and SYSDATE9 are reserved macro variable names, so you need to use some other name like
TIME and DATE respectrively.
Reply all
Reply to author
Forward
0 new messages