<?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 Re: Macros not working properly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911114#M359280</link>
    <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;
&lt;P&gt;I have tried after the ( quit; ), but Still, It's not working.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 12:50:38 GMT</pubDate>
    <dc:creator>Shakti_Sourav</dc:creator>
    <dc:date>2024-01-10T12:50:38Z</dc:date>
    <item>
      <title>Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909889#M358843</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;
&lt;P&gt;Please find the below code which contains the macros in into clause, but it's not working properly, please suggest how to do this.&lt;/P&gt;
&lt;P&gt;When I executed this below code, I got an error in &amp;amp;msg_w. . Also, find the screenshot for your reference.&lt;/P&gt;
&lt;P&gt;I have tried ( " " and ' ' ) quoted mark, still not working properly, but sometimes it's working with quotation mark or without quotation mark.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Note: I have used this code in SAS Data Integration - User written Transformation and the Code Section.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error Screenshot :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shakti_Sourav_0-1703833603673.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92126i23858FAB2D598D64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Shakti_Sourav_0-1703833603673.png" alt="Shakti_Sourav_0-1703833603673.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS CODE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA work.logs;
infile  "/sasconf/Config/Lev1/SASApp/BatchServer/Logs/DLY_CORE_SAMPLING_RPT_SAMPLING_PENDENCY_REPORT_2023.12.29_09.00.43.log" truncover;
input a_line $200.;
if index(compress(a_line), 'ERROR:') &amp;gt; 0 or
index(compress(a_line), 'ERROR ');
run;

proc sort data=work.logs out=work.demo nodup;
by a_line ;
run;

data log1;
set work.logs;
by a_line notsorted;
flag=prxmatch("/^ERROR:/",a_line);
if flag=0 then delete;
run;

data work.W2JOY0AE0;
set log1 (obs=1);
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;

proc sql noprint;
select new_string into:msg_w
from work.W2JOY0AE0;
quit;

proc sql;
update CORE.control_test
set
ERROR_MSG=&amp;amp;msg_w.
where TABLE_NAME='CORE_M_MIS_MDPA_TARGET';
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2023 07:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909889#M358843</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2023-12-29T07:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909890#M358844</link>
      <description>&lt;P&gt;If your source table&amp;nbsp;work.W2JOY0AE0 doesn't contain any row then the SQL into :... won't create the macro variable. To avoid this issue add before the Proc SQL.&lt;/P&gt;
&lt;PRE&gt;%let&amp;nbsp;msg_w=;&lt;/PRE&gt;
&lt;P&gt;You also need to pass the macro variable within quotes.&lt;/P&gt;
&lt;PRE&gt;ERROR_MSG="&amp;amp;msg_w."&lt;/PRE&gt;
&lt;P&gt;Also plan what should happen if there are multiple ERROR messages in your SAS log. You ideally capture the first one. Right now your code would populate &amp;amp;msg_w with the last one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 07:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909890#M358844</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-29T07:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909891#M358845</link>
      <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;
&lt;P&gt;I have mentioned the (obs=1) in the data step as,&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;data work.W2JOY0AE0;
set log1 (obs=1);
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc sql noprint;
select new_string into:msg_w
from work.W2JOY0AE0;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So in the above macros, msg_w contains an ERROR the work.xyz doesnot exist in a single row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the double and single quotation mark, sometime it's working fine but not frequently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shakti&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 07:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909891#M358845</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2023-12-29T07:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909894#M358847</link>
      <description>&lt;P&gt;Post the complete (all code and all messages) log from the whole code you posted in the correct way I already showed you in your other thread.&amp;nbsp;&lt;STRONG&gt;Do not post pictures!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 10:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909894#M358847</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-29T10:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909896#M358848</link>
      <description>&lt;P&gt;ok - obs=1 ensures that you only keep the first line with keyword ERROR. An alternative would be to already implement such logic in your previous data step - something like below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data log1;
  set work.logs;
  by a_line notsorted;
  if prxmatch("/^ERROR:/",a_line) then 
    do;
      output;
      stop;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You still need to define macro variable&amp;nbsp;&amp;amp;msg_w. before the Proc SQL to ensure it does exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This macro variable contains a string so you certainly need to have it in double quote for passing the resolved macro variable (the string) to a SAS variable.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1703846424915.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92128iB33FF4B49D07B649/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1703846424915.png" alt="Patrick_0-1703846424915.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Furthermore:&lt;/P&gt;
&lt;P&gt;The update will of course also execute if there is no error in your log. In this case it's going to update with a blank (IF the macro variable exists!).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...and for things to work you need to pre-populate table CORE.control_test so that there is a row with&amp;nbsp;TABLE_NAME='CORE_M_MIS_MDPA_TARGET'.&amp;nbsp; You could also consider to use the flow basename (without the datetime portion) as your key. Or eventually maintain a log table where you actually also add the datetime portion and INSERT if running for a new date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 10:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909896#M358848</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-29T10:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909902#M358849</link>
      <description>&lt;P&gt;First the logic to detect SAS error messages is wrong.&amp;nbsp; You are just looking for the string ERROR: anywhere in the line.&amp;nbsp; &lt;STRONG&gt;That will generate false positives&lt;/STRONG&gt; for any place where the SAS log just happens to have those characters.&amp;nbsp; For example if you had this line in your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if x &amp;lt;= 0 then put 'ERROR: X must be positive. ' x= ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your search will tag it as an error even if no error message was ever written to the line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always looks for the ERROR text starting in column one.&amp;nbsp;Also some SAS error messages have other text between the word ERROR and the colon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is and example data step to collect the lines of error messages from a SAS log.&lt;/P&gt;
&lt;P&gt;Why not add the table name into this dataset also?&amp;nbsp; And some indication of where in the file the error line appeared?&amp;nbsp; You can also add some simple logic to insure that you always get at least one observation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data error_lines ;
  length lineno 8 table_name $32 error_msg $200 ;
&amp;nbsp; TABLE_NAME="CORE_M_MIS_MDPA_TARGET";
  if _n_=1 and eof then output;
  infile  "/sasconf/Config/Lev1/SASApp/BatchServer/Logs/DLY_CORE_SAMPLING_RPT_SAMPLING_PENDENCY_REPORT_2023.12.29_09.00.43.log"
   end=eof ;
  lineno + 1;
  input ;
  ERROR_MSG = _infile_;
  if ERROR_MSG=:'ERROR' and index(ERROR_MSG,':') then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Not sure why you want to modify data that is already in a dataset using SQL's UPDATE statement.&amp;nbsp; &lt;STRONG&gt;But there is no need to first move the value into a macro variable.&amp;nbsp;&lt;/STRONG&gt; Just update directly form the actual variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
update CORE.control_test 
 set ERROR_MSG=
   (select error_msg from error_lines(obs=1) 
    where TABLE_NAME='CORE_M_MIS_MDPA_TARGET')
 where TABLE_NAME='CORE_M_MIS_MDPA_TARGET'
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But is is much easier (and SAFER) to not try and change data that is already in a dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you did need to make some type of summary dataset that combined the data from scanning multiple log files then you could just use PROC APPEND.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc append base=summary data=error_lines(obs=1) force;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course if you want to scan a lot of files then you could also just do that in the initial data step.&amp;nbsp; You can use the FILENAME= option on the INFILE statement to allow you to find the name of the file with the error message.&amp;nbsp; If you wanted to summarize to one line per log file you could use PROC SQL aggregate functions or even better use PROC SUMMARY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Dec 2023 00:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909902#M358849</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-31T00:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909908#M358852</link>
      <description>&lt;P&gt;A big issue from your program was already mentioned:&amp;nbsp; with no errors, SQL fails to populate &amp;amp;msg_w.&amp;nbsp; Here's a tweak that puts you on the road to accommodating that situation.&amp;nbsp; Your middle DATA step is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.W2JOY0AE0;
set log1 (obs=1);
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Change that so it populates &amp;amp;msg_w when there is no error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.W2JOY0AE0;
if done then call symput("msg_w", 'no errors');
set log1 (obs=1) end=done;
new_string=compbl(translate(a_line,'',':()=+'));
keep new_string;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course you could use any value you would like for &amp;amp;msg_w, but this at least guarantees that &amp;amp;msg_w will exist when you have no errors.&amp;nbsp; Of course if there is an error, this tweak lets the program run as it did before.&lt;/P&gt;
&lt;P&gt;Adjust the logic as you would like from that DATA step forward.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 17:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909908#M358852</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-12-29T17:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909951#M358876</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/390064"&gt;@Shakti_Sourav&lt;/a&gt;&amp;nbsp;- This appears to be one of a number of posts from you recently regarding analysing SAS logs. Are you aware that SAS already provides such functionality - &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p0sf63lx4fs2m5n14qv1bn8p863v.htm" target="_blank" rel="noopener"&gt;PROC SCAPROC&lt;/A&gt;? You may wish to explore use of SCAPROC, rather than coding a fully DIY solution.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 21:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/909951#M358876</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-12-30T21:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911107#M359276</link>
      <description>&lt;P&gt;Thanks, Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried the same code in the SAS DI table Loader Precode &amp;amp; Postcode and SAS EG.&lt;/P&gt;
&lt;P&gt;This code is working fine in SAS EG and is updated in DB and I used the same code in the SAS DI (Table Loader Precode and postcode).&lt;/P&gt;
&lt;P&gt;Then after I execute the particular job in SAS DI, The Table loader precode and postcode not working but if I execute the table loader only, It's updating successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached some screenshots for your reference and also attached the code. please look into it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Job:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shakti_Sourav_0-1704888360778.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92422i772F925FA6F5C77B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Shakti_Sourav_0-1704888360778.png" alt="Shakti_Sourav_0-1704888360778.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table Loader :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shakti_Sourav_1-1704888427705.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92423i4DFF9AF2167B402D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Shakti_Sourav_1-1704888427705.png" alt="Shakti_Sourav_1-1704888427705.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR_MSG=NUll in DB:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shakti_Sourav_2-1704888502904.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92424i3E4A9DA9909CB1FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Shakti_Sourav_2-1704888502904.png" alt="Shakti_Sourav_2-1704888502904.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
select hour(JOB_START_TIME) INTO:hour
from report.CONTROL_TABLE_RPT_TEST WHERE TABLE_NAME="RPT_DISP_SHORTFALL";
quit;&lt;BR /&gt;
%let hourr=&amp;amp;hour.;&lt;BR /&gt;
%let date=%sysfunc(date(), yymmddp10.);

data error_lin;
  length lineno 8 table_name $32 error_msg $200;
  TABLE_NAME="RPT_DISP_SHORTFALL1";
  if _n_=1 and eof then output;
  infile  "/sasconf/Config/Lev1/SASApp/BatchServer/Logs/DLY_RPT_CUSTOMI_REPORT_*_RPT_DISPATCH_SHORTFALL1_&amp;amp;date._&amp;amp;hourr..*.log"
   end=eof;
  lineno + 1;
  input;
  ERROR_MSG = _infile_;
  if (ERROR_MSG=:'ERROR' and index(ERROR_MSG,':')) OR ERROR_MSG='' then output;
run;

proc sql;
update REPORT.CONTROL_TABLE_RPT_TEST 
 set ERROR_MSG=(select ERROR_MSG from error_lin(obs=1) where error_msg&amp;lt;&amp;gt;'')
 where TABLE_NAME='RPT_DISP_SHORTFALL';
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note: In code ( * ) means, It's indicating the whatever name or seconds are there it will take from the path by the max date which is defined in date macros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the server path:&amp;nbsp;&lt;CODE class=" language-sas"&gt;DLY_RPT_CUSTOMI_REPORT_5_RPT_DISPATCH_SHORTFALL1_2024.01.10_12.01.30.03937.log&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;trying by sas code:&amp;nbsp;&lt;CODE class=" language-sas"&gt;DLY_RPT_CUSTOMI_REPORT_*_RPT_DISPATCH_SHORTFALL1_&amp;amp;date._&amp;amp;hourr..*.log.&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;It's&amp;nbsp;working&amp;nbsp;fine&amp;nbsp;but&amp;nbsp;not&amp;nbsp;execute&amp;nbsp;in&amp;nbsp;Table&amp;nbsp;Loader&amp;nbsp;pre&amp;nbsp;&amp;amp; Post&amp;nbsp;code&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;Shakti Sourav Mohapatra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911107#M359276</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2024-01-10T12:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911109#M359277</link>
      <description>&lt;P&gt;One way to debug DIS code is to just copy/paste the generated code into EG and then run it step by step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't show us all the pre- and post-code but from what you show us there is at least a quit; missing in the post-code and it is likely not identical to your current EG code version.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1704889372333.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92425i15BFB9EAD62EA9B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1704889372333.png" alt="Patrick_0-1704889372333.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911109#M359277</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-10T12:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911114#M359280</link>
      <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;
&lt;P&gt;I have tried after the ( quit; ), but Still, It's not working.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911114#M359280</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2024-01-10T12:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911115#M359281</link>
      <description>&lt;P&gt;Did you copy/paste the DIS code into EG and test it from there? Does the issue this way still exist? And if yes: What's different as compared to the EG code where you state things are working?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:53:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911115#M359281</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-10T12:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911117#M359282</link>
      <description>&lt;P&gt;yes, It's Updated in SAS EG.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Shakti_Sourav_0-1704891379857.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92426i55F48DE81B8E7648/image-size/large?v=v2&amp;amp;px=999" role="button" title="Shakti_Sourav_0-1704891379857.png" alt="Shakti_Sourav_0-1704891379857.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911117#M359282</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2024-01-10T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911121#M359283</link>
      <description>&lt;P&gt;And this is the exact code copied from DIS? Not only the pre-code but the whole program code copied into EG and run.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 13:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911121#M359283</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-10T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911136#M359289</link>
      <description>&lt;P&gt;You are using the YYMMDDP format to generate the periods in the day of the year part of the filename.&amp;nbsp; How do you expect to generate the periods in the time of day part of the filename?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I an see possible issues with your LOGIC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) The value of&amp;nbsp;JOB_START_TIME in the dataset REPORT.CONTROL_TABLE_RPT_TEST does not look like the string that you need.&amp;nbsp; What type of variable is that? If numeric does it have a format attached? What format?&amp;nbsp; If it is a numeric variable with TIME values then you will want to format it properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) The value from the dataset even if styled in the way you need it does not actually match the value used to name the file.&amp;nbsp; Either it is just different (perhaps by just a minute or two) or there are multiple observations selected by your first query to find the HOUR and you using the wrong one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Why are you using the control dataset to find the time of day but using the system clock to find the day of the year?&amp;nbsp; What if this log was generated at 10PM and you can this program at 1AM the next day?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 14:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911136#M359289</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-10T14:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macros not working properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911237#M359325</link>
      <description>&lt;P&gt;I have copied the whole job and executed it.&lt;/P&gt;
&lt;P&gt;The Error_Msg variable updated successfully in DB without any error&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 06:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-not-working-properly/m-p/911237#M359325</guid>
      <dc:creator>Shakti_Sourav</dc:creator>
      <dc:date>2024-01-11T06:36:36Z</dc:date>
    </item>
  </channel>
</rss>

