This has me close. When I run this code, I get the data for the first day of the quarter only. (4-1-2018). I thought it was due to having the last day being today. My API's do not like that. I changed the endate parameter by adding -1. I have the code blow. I also tried to make the url length higher but that had no effect either. Any idea why I only get one days data? filename criteo '/opt/sas/data/sasuser/sn161735/criteo.json'; data _null_; enddate=today()-1; begindate=intnx('qtr',enddate,0,'b'); token='xxx'; length url $1300 ; url=quote(cats('https://publishers.criteo.com/api/2.0/stats.json?apitoken=',token ,'&begindate=',put(begindate,yymmddd10.) ,'&enddate=',put(enddate,yymmddd10.) ,'&metrics=Date;TotalImpression;CPM;Revenue;WinRate' ),"'"); call symputx('url',url); call symputx('webusername',quote("cturley@sxx")); call symputx('webpassword',quote("xxx")); run; proc http url=&url method="GET" out=criteo webusername=&webusername webpassword=&webpassword AUTH_BASIC ; run; PROC SQL; CREATE TABLE CRITEO_DATA AS SELECT t1.date, t1.totalImpression FORMAT=COMMA9. AS totalImpression, t2.value FORMAT=DOLLAR9.2 AS Revenue, t3.value FORMAT=DOLLAR6.2 AS CPM FROM CRITEO.ROOT t1, CRITEO.REVENUE t2, CRITEO.CPM t3 WHERE (t1.ordinal_root = t2.ordinal_root AND t1.ordinal_root = t3.ordinal_root); QUIT;
... View more