So I understand how to set up automatic dates in SAS:
/* Normal Date (today) */
%let Today_SAS = %sysfunc(date(),Date9.); %LET Run_Date = %SYSFUNC(INPUTN(&Today_SAS., Date9.));
/*This will give the date 3 months back */ %LET Three_SAS = %SYSFUNC(INTNX(MONTH, &Run_Date., -3., B), Date9.); /* This will give the date 6 months back */ %LET Six_SAS = %SYSFUNC(INTNX(MONTH, &Run_Date., -6., B), Date9.); /* This will give the date 9 months back */ %LET Nine_SAS = %SYSFUNC(INTNX(MONTH, &Run_Date., -9., B), Date9.); /* This will give the date 12 months back */ %LET Twelve_SAS = %SYSFUNC(INTNX(MONTH, &Run_Date., -12., B), Date9.);
My Question is how do I pass this macro into a Hadoop HIVE passthrough?
Here is a crude example below of the code I am using to pass through to Hadoop. I am hoping to automate the date process, but I am at a loss on this one.
Proc SQL noerrorstop;
Connect to HADOOP (server='xxx' port=xxx);
Execute (set mapreduce.job.queuename=sas.xxx) by HADOOP;
Execute (set parquet.compression=SNAPPY) by HADOOP;
Execute (drop table if exists test.test) by HADOOP;
Execute (create table test.test stored as parquet as
select distinct
a.Element1,
a.Element2,
a.Element3,
a.Element4,
b.Element5
from Test.Test2 as a
LEFT JOIN Test.Test3 b on
a.ElementJoin=b.ElementJoin
where to_date(b.Element5) >= ('2018-01-01')
) by hadoop;
quit;
Thanks for any suggestions or helpful material to reference.
... View more