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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.