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

Hi All,

I would like to get SAS running job while time() < '21:40:00't .

Can you please help to fix it?

Thanks,

HHC

%macro doeveryminute() ;

  %*beware the infinite loop ;
  %do %while ( time() < '21:40:00't) ;

  MY CODE.....

  %end ;

%mend ;

%doeveryminute();

 

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

 

%macro do_while_time;
  %do %while (%sysfunc(time(),time8.0) LE 23:25:29);
    *code here **;
  %end;
%mend;
%do_while_time

Macro is a TEXT language, so you can't use the time-literal notation  ('23:25:59't).

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

2 REPLIES 2
mkeintz
PROC Star

 

%macro do_while_time;
  %do %while (%sysfunc(time(),time8.0) LE 23:25:29);
    *code here **;
  %end;
%mend;
%do_while_time

Macro is a TEXT language, so you can't use the time-literal notation  ('23:25:59't).

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Ksharp
Super User
%macro doeveryminute ;
  %do %while (  %sysevalf(%sysfunc(time())<'21:40:00't,boolean)  ) ;

%put  MY CODE.....;

  %end ;
%mend ;

%doeveryminute
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1088 views
  • 2 likes
  • 3 in conversation