Say I have a table containing date variable and I want to recursively referring to taq libraries such as:
data zzz;
set taqms.&type._&yyyymmdd;
if ('9:35:00't) <= time_m <=('14:35:00't);
run;
where &type=ctm and &yyyymmdd is the date variable converted in to the form "yyyymmdd" inside a macro.
But the %let command do not work well with date type variable and I am not able to assign the specific row observation to the &yyyymmdd variable.
For example, the date table:
And I want to recursively referring to taq libraries according to the date values above.
SAS date is a numeric variable containing number of days since 01JAN1960.
In order to assign the date in a format of yyyymmdd into a macro variable yyyyyo need to reformat it.
In the table you have a lot of different dates. Which of them you want to assign to the macro variable?
and how did you try to do it?
a singlae date can be assigned to a macro variable, in a sas datastep, using
call symput('macro_var', put(date_var, yymmdd8.);
Better post your full code in oredr to get more accurate answer.
Thank you for your response. I would like to assign every date (each at the time, I have a do loop in the macro function) to the macro and perform something like this:
proc sql; create table temp as
select a.*, b.cusip, b.secd
from taqms.&type._&day a, loca2 b
where a.sym_root=b.symbol and (b.sect-&window) <= a.time_m <= (b.sect+&window)
order by b.symbol;
quit;
where loca2 is link table for smybol and cusip.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.