<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic time varaiables are not resolved with sassrv account in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786320#M251035</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro testmacro;
	%let run_time=%sysfunc(time(),time16.);
    %let start_time=%sysfunc(putc(19:30:00,time16.)); /*from today 19:00 to tommarow 07:00 AM */
    %let end_time=%sysfunc(putc(07:00:00,time16.));
	 %let test_value =((&amp;amp;start_time. &amp;gt; &amp;amp;run_time.) or (&amp;amp;run_time. &amp;lt; &amp;amp;end_time.));
   %put this is to test test_value :::&amp;amp;test_value.;
    %if  ((&amp;amp;start_time. &amp;gt; &amp;amp;run_time.) or (&amp;amp;run_time. &amp;lt; &amp;amp;end_time.))  %then %do;
      %put execute the code;
	      %end;

	  	%else %do;
          %put dont execute the code;
     %end;

%mend;
%testmacro;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello Team ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;am trying to execute above code , it works perfectly when i execute from sas EG&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when i am trying to execute with sas BI webservices (which uses sassrv account (stored process server)&lt;/P&gt;
&lt;P&gt;to execute this code am getting below error message&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: Argument 2 to function PUTC referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;/P&gt;
&lt;P&gt;The SAS System&lt;/P&gt;
&lt;P&gt;WARNING: Argument 2 to function PUTC referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;this is to test test_value :::(( &amp;gt; 18:38:33) or (18:38:33 &amp;lt; ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Means the&amp;nbsp;&lt;CODE class=" language-sas"&gt;start_time and&amp;nbsp;end_time&amp;nbsp;are&amp;nbsp;not&amp;nbsp;resolved&amp;nbsp;because&amp;nbsp;of&amp;nbsp;above&amp;nbsp;warning&amp;nbsp;message&amp;nbsp;and&amp;nbsp;always&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;entered&amp;nbsp;in&amp;nbsp;to&amp;nbsp;else&amp;nbsp;statement&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;can&amp;nbsp;you&amp;nbsp;post&amp;nbsp;your&amp;nbsp;suggestions&amp;nbsp;on&amp;nbsp;this&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Dec 2021 17:15:34 GMT</pubDate>
    <dc:creator>learn_SAS_23</dc:creator>
    <dc:date>2021-12-16T17:15:34Z</dc:date>
    <item>
      <title>time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786320#M251035</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro testmacro;
	%let run_time=%sysfunc(time(),time16.);
    %let start_time=%sysfunc(putc(19:30:00,time16.)); /*from today 19:00 to tommarow 07:00 AM */
    %let end_time=%sysfunc(putc(07:00:00,time16.));
	 %let test_value =((&amp;amp;start_time. &amp;gt; &amp;amp;run_time.) or (&amp;amp;run_time. &amp;lt; &amp;amp;end_time.));
   %put this is to test test_value :::&amp;amp;test_value.;
    %if  ((&amp;amp;start_time. &amp;gt; &amp;amp;run_time.) or (&amp;amp;run_time. &amp;lt; &amp;amp;end_time.))  %then %do;
      %put execute the code;
	      %end;

	  	%else %do;
          %put dont execute the code;
     %end;

%mend;
%testmacro;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello Team ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;am trying to execute above code , it works perfectly when i execute from sas EG&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when i am trying to execute with sas BI webservices (which uses sassrv account (stored process server)&lt;/P&gt;
&lt;P&gt;to execute this code am getting below error message&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: Argument 2 to function PUTC referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;/P&gt;
&lt;P&gt;The SAS System&lt;/P&gt;
&lt;P&gt;WARNING: Argument 2 to function PUTC referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;this is to test test_value :::(( &amp;gt; 18:38:33) or (18:38:33 &amp;lt; ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Means the&amp;nbsp;&lt;CODE class=" language-sas"&gt;start_time and&amp;nbsp;end_time&amp;nbsp;are&amp;nbsp;not&amp;nbsp;resolved&amp;nbsp;because&amp;nbsp;of&amp;nbsp;above&amp;nbsp;warning&amp;nbsp;message&amp;nbsp;and&amp;nbsp;always&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;entered&amp;nbsp;in&amp;nbsp;to&amp;nbsp;else&amp;nbsp;statement&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;can&amp;nbsp;you&amp;nbsp;post&amp;nbsp;your&amp;nbsp;suggestions&amp;nbsp;on&amp;nbsp;this&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 17:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786320#M251035</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2021-12-16T17:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786328#M251041</link>
      <description>&lt;P&gt;I am surprised that your PUTC works at all, as TIME is not a character format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use SAS time values (count of seconds) throughout your code, and you can use macro variables containing the raw values without hassle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start_time=%sysevalf('19:30:00't);
%put &amp;amp;=start_time.;
%let start_time=%sysfunc(inputn(19:30:00,time8.));
%put &amp;amp;=start_time;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Two simple methods of converting human-readable strings into time values that can be used anywhere where comparisons with SAS time values are needed.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 17:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786328#M251041</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-16T17:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786358#M251061</link>
      <description>Thanks for quick help ,it works with count of seconds</description>
      <pubDate>Thu, 16 Dec 2021 19:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786358#M251061</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2021-12-16T19:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786392#M251076</link>
      <description>&lt;P&gt;What are you trying to do?&lt;/P&gt;
&lt;P&gt;You are currently taking a circular route to setting macro variables to strings (complete&amp;nbsp; with colons in them) that will look to humans a lot like time of day values.&amp;nbsp; &amp;nbsp;You could do that much easier.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let run_time=%sysfunc(time(),time8.);
%let start_time=19:30:00;
%let end_time=07:00:00;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But using the TIME format instead of the TOD format will cause trouble when run before 10 AM since it will not include the leading zero.&amp;nbsp; So 8AM will come out as "8:00:00" instead of "08:00;00" and so it will be larger than both your other strings instead of being between them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let run_time=%sysfunc(time(),tod8.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to compare times across days you probably want to use DATETIME values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if you want to calculate execution duration you should use DATETIME values just in case you start on one date and end on another.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 22:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786392#M251076</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-16T22:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786421#M251092</link>
      <description>Thanks for finding it out and tips , as i am a learner to the macro language trying different ways to define time constant to a variable.&lt;BR /&gt;thanks so much for tips .&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Dec 2021 08:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786421#M251092</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2021-12-17T08:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: time varaiables are not resolved with sassrv account</title>
      <link>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786425#M251094</link>
      <description>&lt;P&gt;..for completeness..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**TIME;&lt;BR /&gt;%let start_time=%sysevalf('19:30:00't);&lt;BR /&gt;%put &amp;amp;=start_time.;&lt;BR /&gt;%let start_time=%sysfunc(inputn(19:30:00,time8.));&lt;BR /&gt;%put &amp;amp;=start_time;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**DATE;&lt;BR /&gt;%let start_date=%sysevalf('19mar2021'd);&lt;BR /&gt;%put &amp;amp;=start_date.;&lt;BR /&gt;%let start_date=%sysfunc(inputn(19mar2021,date9.));&lt;BR /&gt;%put &amp;amp;=start_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;** DATETIME;&lt;BR /&gt;%let start_datetime=%sysevalf('19mar2021 15:12:22'dt);&lt;BR /&gt;%put &amp;amp;=start_datetime.;&lt;BR /&gt;%let start_datetime=%sysfunc(inputn(19mar2021:15:12:22,anydtdtm23.));&lt;BR /&gt;%put &amp;amp;=start_datetime;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 10:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/time-varaiables-are-not-resolved-with-sassrv-account/m-p/786425#M251094</guid>
      <dc:creator>AndreaVianello</dc:creator>
      <dc:date>2021-12-17T10:01:04Z</dc:date>
    </item>
  </channel>
</rss>

