BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

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;
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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;

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

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;
sbxkoenk
SAS Super FREQ

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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 982 views
  • 0 likes
  • 3 in conversation