hello,
I am using a proc http to check if a Bearer Token is valid and how much time it will be valid.
However, this value does not change with time. Is there a way to start some kind of chronometer and to put this value into a macro variable to estimate the remaining time.
P P1 V Value
1 access_token 1 xxxxxxxxxxxxxxxxxxxxxxxxxxx
1 token_type 1 Bearer
1 expires_in 1 3599
1 scope 1 read:survey_responses read:users
libname auth json fileref=resp;
data test;
set auth.root;
call symputx('BearerToken',access_token,'g');
call symput('BTExpIn',expires_in);
run;
%put &=BearerToken &=BTExpIn;
Assuming that expiry time is in seconds, the token lasts for 1 hour:
data _null_;
Now_Time = time();
Expire_Time = intnx('SECOND',Now_Time , 3599);
format Now_Time Expire_Time time8.;
put _all_;
run;
Assuming that expiry time is in seconds, the token lasts for 1 hour:
data _null_;
Now_Time = time();
Expire_Time = intnx('SECOND',Now_Time , 3599);
format Now_Time Expire_Time time8.;
put _all_;
run;
Hello ,
You can sound an alarm after x number of seconds :
data _NULL_;
/* The following example tells SAS to delay the execution */
/* of the DATA step _NULL_ for 20 seconds: */
time_slept=sleep(20,1);
/* The following statement produces a tone of */
/* frequency 523 cycles per second (middle C) lasting 2 seconds: */
call sound(523,2000);
run;
Koen
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.