/* testfindavar.sas 070803 Daniel Brockman */ *-------------------------------------------------------; %let dir=C:\b\SAS-X405.5 ; * root directory ; *-------------------------------------------------------; %let prg=&dir\prg ; * program subdirectory ; %let sub=&dir\sub; * subdir containing autoloaded macros ; %let dat=&dir\data ; * data subdirectory ; %let rpt=&dir\rpt ; * reports and outputs subdirectory ; *-------------------------------------------------------; %let outfile="&rpt\BP-corr-wndos.txt" ; * output file for corr triangle ; %let DorN=N ; * numeric window selection (see corrwndo()); %let wstart=20 ; * first observation or date for first time window; %let wlen=30 ; * length of time window in days ; %let wintvl=3 ; * length in days of interval between windows ; %let inset=bpset1 ; * input data set; %let inset=bpsetdtkg; %let exset=&inset._ex1 ; * exception list data set ; %let Dv=Sd ; * name of calculated SAS datevalue var ; %let Chrono=Sdt ; * name of date for chronological sort ; %let vvol=Sys Dia Pul Wt WtKg ; * vars for volatility calc ; %let voth=Hour ; * other variables to maintain ; %let vcor=&Dv &voth &vvol ; * vars for corr calc ; %let V=7 ; * num of days for calc of annualized volatility; %let ann=365.25 ; * days/yr assumption for calc of ann'zed vol ; %put sub:&sub: inset:&inset ; libname corral "&dat" ; %let tr = tempo00 ; * root name for tempo data set ; %global greturn ; * used for return values from certain macros ; %global greturn1 ; options ls = 80 mprint mlogic symbolgen sasautos="&sub" /* doublequotes required */ spool ; proc printto; run; /* restore default destinations */ * macros not in autocall library and macros in test ; * tested * %include "&sub\cvtymdsas.sas" ; %include "&sub\findavar.sas" ; * %include "&sub\trimset.sas" ; * %include "&sub\annvol.sas" ; * %include "&sub\cchg.sas" ; * %include "&sub\getdsname.sas" ; * %include "&sub\dtchkf.sas" ; * %include "&sub\consecdays.sas"; * %include "&sub\clog.sas"; *-------------------------------------------------------; data tempo ; input cabbage1 cabbage2 cabbage3 ; cards; 3 5 6 7 5 6 10 10 12 17 15 18 27 25 30 ; run; %let greturn=carrot; %findavar(tempo,cabbage) ; %let mynewvar=&greturn ; %put M65 mynewvar:&mynewvar ; data tempo2 ; set tempo ; retain &mynewvar 8 ; &mynewvar.=&mynewvar.+1 ; run; proc print data=tempo2; run; /**/