<?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>hhchenfx Tracker</title>
    <link>https://communities.sas.com/kntur85557/tracker</link>
    <description>hhchenfx Tracker</description>
    <pubDate>Tue, 21 Apr 2026 13:46:30 GMT</pubDate>
    <dc:date>2026-04-21T13:46:30Z</dc:date>
    <item>
      <title>Re: Help with Do Loop return incorrect result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Do-Loop-return-incorrect-result/m-p/968787#M376635</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;Thanks for checking.&lt;/P&gt;
&lt;P&gt;I found the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	if gap&amp;lt;60 then do;
			if J_low&amp;lt;=low+add_level_3 then do;
			 	entry_time=J_clock_time;
				entry_price=ceil(low * 100) / 100+ add_level_3;
				bigbar=clock_time;
				out=1; leave;
				end;end;
	else 
	if gap&amp;lt;120 then do;
			if J_low&amp;lt;=low+add_level_4 then do;
			 	entry_time=J_clock_time;
				entry_price=ceil(low * 100) / 100+ add_level_4;
				bigbar=clock_time;
				out=1; leave;
				end;end;
	else 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jun 2025 19:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Do-Loop-return-incorrect-result/m-p/968787#M376635</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2025-06-11T19:07:28Z</dc:date>
    </item>
    <item>
      <title>Help with Do Loop return incorrect result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Do-Loop-return-incorrect-result/m-p/968777#M376631</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an issue with the result produced by the below loop code.&lt;/P&gt;
&lt;P&gt;Basically, when body_50 =1 bar[i], then look forward when condition: new row's low[j] &amp;lt; low[i] +&amp;nbsp;add_level_1[i] then mark:&lt;/P&gt;
&lt;P&gt;1 - entry_time = time[j]&lt;/P&gt;
&lt;P&gt;2 - entry_price =ceil(low[i] * 100) / 100+ add_level_1[i]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown in the picture attached, on the row 9:27, body_1 =1 with low[i] +&amp;nbsp;add_level_1[i] = 231.13 and SAS starts look forward.&lt;/P&gt;
&lt;P&gt;BUT it pick row 9:30 where low is 131.50 which is &lt;U&gt;bigger&lt;/U&gt; than&amp;nbsp;231.13. It means the condition is Not met and somehow SAS still pick that row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hhchenfx_2-1749665548842.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107752i09C967A91AA7CB71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hhchenfx_2-1749665548842.png" alt="hhchenfx_2-1749665548842.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sort data=ss; by tic date clock_time;run;

data ss1; set ss nobs=nobs;
drop i j_: out ;
format entry_time bigbar time9.;
i+1;
out=0;
by tic;
if  body_50=1 then do; 
	do j=i+1 to nobs until (out=1);
	set ss (keep=tic date clock_time low high rename = (tic=J_tic date=J_date clock_time=J_clock_time low=J_low high=J_high) ) point=j;

			low_plus_add_level_1=low+add_level_1 ;
			gap=(J_clock_time - clock_time) / 60;

	if date^=J_date or tic^=J_tic or J_clock_time&amp;gt;'15:30't then do; out=1; leave; end;
	else
	if gap&amp;lt;20 and J_low&amp;lt;=low+add_level_1 then do;
		 	entry_time=J_clock_time;
			entry_price=ceil(low * 100) / 100+ add_level_1;
			bigbar=clock_time;
			out=1; leave;
			end;
	else 
	if gap&amp;lt;60 and J_low&amp;lt;=low+add_level_3 then do;
		 	entry_time=J_clock_time;
			entry_price=ceil(low * 100) / 100+ add_level_3;
			bigbar=clock_time;
			out=1; leave;
			end;
	else 
	if gap&amp;lt;120 and J_low&amp;lt;=low+add_level_4 then do;
		 	entry_time=J_clock_time;
			entry_price=ceil(low * 100) / 100+ add_level_4;
			bigbar=clock_time;
			out=1; leave;
			end;
	else 
	if gap&amp;lt;180 and J_low&amp;lt;=low+add_level_5 then do;
		 	entry_time=J_clock_time;
			entry_price=ceil(low * 100) / 100+ add_level_5;
			bigbar=clock_time;
			out=1; leave;
			end;
	else 
	if gap&amp;gt;=180 and J_low&amp;lt;= low +add_level_6 then do;
			entry_time=J_clock_time;
			entry_price=ceil(low * 100) / 100+ add_level_6;
			bigbar=clock_time;
			out=1; leave;
			end;
end;
end;
run;
&lt;/CODE&gt;&lt;/PRE&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>Wed, 11 Jun 2025 18:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Do-Loop-return-incorrect-result/m-p/968777#M376631</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2025-06-11T18:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running time issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-time-issue/m-p/967403#M376354</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;
&lt;P&gt;My ssd is&amp;nbsp;Samsung - 990 PRO 2TB Internal SSD PCle Gen 4x4 NVMe.&lt;/P&gt;
&lt;P&gt;I really dont know what is going on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any Mem setting is SAS can alleviate the issue?&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 May 2025 15:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-time-issue/m-p/967403#M376354</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2025-05-24T15:01:56Z</dc:date>
    </item>
    <item>
      <title>Running time issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-time-issue/m-p/967396#M376350</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data is about 5GB with 20 columns and I run this below code.&lt;/P&gt;
&lt;P&gt;At first, I dont create NEW file and simply overwrite using:&amp;nbsp;&lt;CODE class=" language-sas"&gt;data return_cal_new2; set return_cal nobs=nobs;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;It take me 30&lt;STRONG&gt;+&lt;/STRONG&gt; second and in Task Manager, I see my SSD usage is 100% (My SSD has 500+GB free). It is so weird.&lt;/P&gt;
&lt;P&gt;OK, I change the name to&amp;nbsp;&lt;CODE class=" language-sas"&gt;return_cal_NEW&lt;/CODE&gt;&amp;nbsp;(as in the code below) and run it for the first time. Now it take only 3.4 second using about&amp;nbsp;with about 70% SSD. Great!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look like over-writing is an issue.&lt;/P&gt;
&lt;P&gt;Without deleting the NEW file, I rerun the code 2nd time, and it take me again, 3.3 second with about 70% SSD&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without deleting the NEW file, I rerun the code 3rd, and the weird behavior shows up again, 50 second and 100% SSD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really curious what is going on here. Of course, I try several time and the pattern is similar.&lt;/P&gt;
&lt;P&gt;Is this because of my PC (spec: intel 13700 64GB DDR5) or because of SAS (9.4)? Should I reinstall SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any explanation is very much appreciated.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data return_cal2; set return_cal;
if entry_time^=. then do;
	if entry_time^=. and clock_time&amp;lt;='9:40't and (entry_time-clock_time)/60&amp;lt;=10 then  fail=1;
	else 
	if entry_time^=. and clock_time&amp;gt;'9:40't and (entry_time-clock_time)/60&amp;lt;=5 then  fail=1;
	else
	fail=.;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 May 2025 04:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-time-issue/m-p/967396#M376350</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2025-05-24T04:12:35Z</dc:date>
    </item>
    <item>
      <title>Transpose multiple columns Long to Wide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-multiple-columns-Long-to-Wide/m-p/919887#M362320</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;Is there any better way than the one below?&lt;/P&gt;
&lt;P&gt;If I have to transpose 20 columns, I have to run that SQL 19 times. Of course, I can put that into Macro, but I bet there should be a better method.&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data long2; 
  input famid year faminc spend ; 
cards; 
1 96 40000 38000 
1 97 40500 39000 
1 98 41000 40000 
2 96 45000 42000 
2 97 45400 43000 
2 98 45800 44000 
3 96 75000 70000 
3 97 76000 71000 
3 98 77000 72000 
; 
run ;

proc transpose data=long2 out=widef prefix=faminc;
   by famid;
   id year;
   var faminc;
run;

proc transpose data=long2 out=wides prefix=spend;
   by famid;
   id year;
   var spend;
run;

data wide2;
    merge  widef(drop=_name_) wides(drop=_name_);
    by famid;
run;

proc print data=wide2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 03:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-multiple-columns-Long-to-Wide/m-p/919887#M362320</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-03-12T03:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error Unable to sample external file, no data in first 5 records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Unable-to-sample-external-file-no-data-in-first-5/m-p/919601#M362205</link>
      <description>&lt;P&gt;Thanks, Tom.&lt;/P&gt;
&lt;P&gt;I fixed the typo.&lt;/P&gt;
&lt;P&gt;The error shown when the file doesn't exist &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 22:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Unable-to-sample-external-file-no-data-in-first-5/m-p/919601#M362205</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-03-08T22:57:26Z</dc:date>
    </item>
    <item>
      <title>SAS Error Unable to sample external file, no data in first 5 records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Unable-to-sample-external-file-no-data-in-first-5/m-p/919581#M362199</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I run a macro to check if a csv file exist before importing it.&lt;/P&gt;
&lt;P&gt;When it run the first time, as the csv file is not there yet, it give me a error (instead of move on to Else condition).&lt;/P&gt;
&lt;P&gt;That happen several times.&lt;/P&gt;
&lt;P&gt;Do you guys know what is going on and how to fix?&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro import_csv(file_path);
    %if %sysfunc(fileexist(&amp;amp;file_path.)) %then %do;
		proc import datafile="&amp;amp;file_path" out = runaway_1 replace; run;	%end;
    %else %do;
		%put no data yet;    %end;
%mend;
%import_csv(E:\Run_Away.csv);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2024 22:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Unable-to-sample-external-file-no-data-in-first-5/m-p/919581#M362199</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-03-08T22:56:10Z</dc:date>
    </item>
    <item>
      <title>Get the highest value within a window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-highest-value-within-a-window/m-p/919034#M361997</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;So I have a data with ID, date (not continuous) and value.&lt;/P&gt;
&lt;P&gt;For each row, I create a look back, which is 4 date before.&lt;/P&gt;
&lt;P&gt;I want to find the max value within that 4 date (excluding current date)&lt;/P&gt;
&lt;P&gt;My code below gives me the result but I need to run a sort nodupkey.&lt;/P&gt;
&lt;P&gt;Can you please help me fix it?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input id date value;
datalines;
1 1 3
1 4 7
1 15 3
1 25 20
1 26 8
1 27 15
1 28 5
1 29 5
1 30 5
1 31 6
;
run;

data have; set have;
lookback_date=date - 4;
run;

proc sql;
create table want as select a.*, max(b.value) as max from have as a left join have as b 
on a.id=b.id and a.lookback_date&amp;lt;=b.date and a.date&amp;gt;b.date
group by a.id, a.date;
quit;

proc sort data =want out=want nodupkey; by id date; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 05:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-highest-value-within-a-window/m-p/919034#M361997</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-03-06T05:34:57Z</dc:date>
    </item>
    <item>
      <title>Issue with WORK.PROFILE will be opened instead</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-with-WORK-PROFILE-will-be-opened-instead/m-p/918028#M361637</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I got new PC and I install SAS9.4 in my C: drive (C:\Program Files\SASHome\SASFoundation\9.4).&lt;/P&gt;
&lt;P&gt;I copied my old document from my old PC to the new PC in folder E:\backup as below and in this folder, turns out this back up also has "My SAS Files".&lt;/P&gt;
&lt;P&gt;Now when run my SAS, it always point to this folder with the below error.&lt;/P&gt;
&lt;P&gt;How can I fix it?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Windows error code: 362 in hc_normal_read_uhb for E:\backup\Documents\My SAS Files\9.4\profile.sas7bcat, The cloud file provider
is not running.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 13:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-with-WORK-PROFILE-will-be-opened-instead/m-p/918028#M361637</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-02-27T13:08:39Z</dc:date>
    </item>
    <item>
      <title>import specific sheet of an xlsx file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-specific-sheet-of-an-xlsx-file-into-SAS/m-p/917710#M361501</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I need to import a sheet of an Excel file (xlsx) into SAS using data step (infile rather than import).&lt;/P&gt;
&lt;P&gt;Also, 1 column is date in the format&amp;nbsp;Feb-25-2019 and I don't know how to read it correctly.&lt;/P&gt;
&lt;P&gt;Can you please help?&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 03:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-specific-sheet-of-an-xlsx-file-into-SAS/m-p/917710#M361501</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-02-24T03:10:21Z</dc:date>
    </item>
    <item>
      <title>Macro check if dataset is available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-check-if-dataset-is-available/m-p/916909#M361169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to check if dataset Myfile is already in work library or not. If it is not there yet, create that file.&lt;/P&gt;
&lt;P&gt;The idea can be seen in the code below.&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro check_file_exist;
	%if FILE IS NOT THERE %then %do;
		data Myfile; set _NULL_;
		run;
	%end;
%Mend;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 04:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-check-if-dataset-is-available/m-p/916909#M361169</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-02-20T04:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Combine table to multiply weight to value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-table-to-multiply-weight-to-value/m-p/911893#M359543</link>
      <description>&lt;P&gt;Thank you so much, Tom!&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 01:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-table-to-multiply-weight-to-value/m-p/911893#M359543</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-18T01:04:19Z</dc:date>
    </item>
    <item>
      <title>SAS issue with sum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-issue-with-sum/m-p/911890#M359541</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I run the below code to get weight schedule.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that when I want to get (sum of element)=1, SAS do not return row value such as factor1=0, factor2=0 and factor3=1.&lt;/P&gt;
&lt;P&gt;I am not sure if it is my SAS issue or else, thus I keep the count in each part so you can can check.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help to review?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  do factor1 = 0 to 1 by 0.1;
    do factor2 = 0 to 1 by 0.1;
      do factor3 = 0 to 1 by 0.1;
		output;
      end;
    end;
  end;
run;
/*The data set WORK.HAVE has 1331 observations and 3 variables*/

data weight_schedule; set have;
if factor1 + factor2 + factor3 = 1;
run;
/*The data set WORK.WEIGHT_SCHEDULE has 53 observations*/&lt;BR /&gt;&lt;BR /&gt;/********this return CORRECT count*******/&lt;BR /&gt;&lt;BR /&gt;data CORRECT_COUNT; set have;&lt;BR /&gt;if 0.99&amp;lt;factor1 + factor2 + factor3&amp;lt;1.01;&lt;BR /&gt;run;&lt;BR /&gt;/* The data set WORK.W has 66 observations*/&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jan 2024 00:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-issue-with-sum/m-p/911890#M359541</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-18T00:34:45Z</dc:date>
    </item>
    <item>
      <title>Combine table to multiply weight to value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Combine-table-to-multiply-weight-to-value/m-p/911869#M359534</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have 2 datasets:&lt;BR /&gt;1- specification contain 4 variable name (v1-v4) and it associated weight (weight1-weight4)&lt;BR /&gt;2- timeseries contain value of each variable name and its value overtime.&lt;/P&gt;
&lt;P&gt;What I want is to take 1 row in specification file and multiply with all rows in timeseries.&lt;BR /&gt;So for the first row in specification, I will create a new dataset from timeseries where I do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if name ='a' then value=value*0; else
if name = 'b' then value=value*0.1; else
if name = 'c' then value=value*0.1; else
if name = 'd' then value=value*0.8;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and keep only those with name a b c d.&lt;/P&gt;
&lt;P&gt;(0, 0.1, 0.1,0.8 is the weight taken from specification file)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I will perform further analysis with this new dataset.&lt;/P&gt;
&lt;P&gt;(This explanation of 1 row is intuition.&lt;BR /&gt;However, if you can help to create a file that contain all multiplication is great)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help?&lt;BR /&gt;Many thanks,&lt;BR /&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data specification;
input var1 $ var2 $ var3 $ var4 $ weight1 weight2 weight3 weight4 ;
datalines;
 a b c d 0 0.1 0.1 0.8
 a b v c 0.7 0.1 0.1 0.1
 ;run;

 data timeseries;
 input name $ value;
 datalines;
 a 1
 a 1.2
 a 1.3
 b 2
 b 2.1
 b 2.2
 c 3
 c 3.1
 c 3.2
 c 3.3
 d 4.1
 d 4.2
 d 4.3
 v 5.1
 v 5.2
 v 5.3
;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jan 2024 20:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Combine-table-to-multiply-weight-to-value/m-p/911869#M359534</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-17T20:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Run code every minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911043#M359251</link>
      <description>&lt;P&gt;Thank you so much for helping!&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 20:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911043#M359251</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-09T20:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run code every minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911036#M359248</link>
      <description>&lt;P&gt;Hi Yabwon,&lt;/P&gt;
&lt;P&gt;Can you make your code run at MM:30?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 17:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911036#M359248</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-09T17:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Run code every minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911031#M359246</link>
      <description>&lt;P&gt;I am running SAS9.4.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 16:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911031#M359246</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-09T16:42:36Z</dc:date>
    </item>
    <item>
      <title>Run code every minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911018#M359242</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;This code below runs every minutes at MM:50.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One problem is that the code run inside take about 30 seconds. Thus, when it starts running at 10:50, it will be done at 11:20 and the next run will be 1 minute later, which is 12:50.&lt;/P&gt;
&lt;P&gt;Thus, the code will not be run at 11:50.&lt;/P&gt;
&lt;P&gt;Can you please help to fix the code to make it runs every MM:50?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

%MACRO RUN_each_MINUTE() ;
%DO %WHILE (   %sysevalf(%sysfunc(time())&amp;lt;'10:00:08't,boolean)  ) ;

	/****MY CODE ****/

    %put %sysfunc(wakeup("%sysfunc(putn(%eval(%sysfunc(intnx(minute,"%sysfunc( time(), time )"t,1))+50),time.))"t));

%end ;

%mend ;

%RUN_each_MINUTE();run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Keep sas sleep here and wake up at next minute at MM:55 to start the loop*/
%put %sysfunc(wakeup("%sysfunc(putn(%eval(%sysfunc(intnx(minute,"%sysfunc( time(), time )"t,1))+40),time.))"t));

%MACRO RUN_each_MINUTE(end) ;
%local t;
%put START;

%DO %WHILE (   %sysevalf(%sysfunc(time())&amp;lt;&amp;amp;end.,boolean)  ) ;
  %let t = %sysfunc(datetime());
  		data _null_;call symput ('start_time',put (time(),time.));run;

  		data a; set sashelp.stocks;run;

		data _null_;call symput ('timenow',put (time(),time.));call symput ('datenow',put (date(),date9.));run;
		%put start time;%put &amp;amp;start_time;
		%put END of RUN;%put &amp;amp;datenow;%put &amp;amp;timenow;

		  /* sleep for remaining time after execution */
		  %let t = %sysevalf(60 - (%sysfunc(datetime()) - &amp;amp;t.));
		  %if %sysevalf(&amp;amp;t. &amp;gt; 0) %then %put %sysfunc(sleep(&amp;amp;t.,1));

%end ;

%put END;
%mend ;
%RUN_each_MINUTE('17:25:08't)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jan 2024 20:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-code-every-minute/m-p/911018#M359242</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-09T20:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Check if current time less than a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-if-current-time-less-than-a-value/m-p/910174#M358967</link>
      <description>&lt;P&gt;Thank you so much for helping!&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 22:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-if-current-time-less-than-a-value/m-p/910174#M358967</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-02T22:47:11Z</dc:date>
    </item>
    <item>
      <title>Check if current time less than a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-if-current-time-less-than-a-value/m-p/910163#M358960</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to compare current time with '4:55't as below but my code is not working.&lt;/P&gt;
&lt;P&gt;Can you please help to fix?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO _BREAK() ;
%let current_time = time(); /* Get the current time */

%IF &amp;amp;current_time &amp;lt; '4:55't %then %do;
	%put "print before ";
	%END;
%ELSE %do;
	%put "print after";
	%END;

%Mend;

%_BREAK();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 21:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-if-current-time-less-than-a-value/m-p/910163#M358960</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2024-01-02T21:09:31Z</dc:date>
    </item>
  </channel>
</rss>

