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

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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