I extracted some code(from SAS communities) to calculate the nth business day of the month. It is a little off. I was testing the code to make sure it returned the 3rd day of the month. I noticed Jul ,Aug, and Oct were giving me the 4th day instead. All these months have 31 days so wondering if that is the reason. I want the 3 day of the month and will adjust for holidays for Jan, Jul and Sept only when it falls on a weekend. Can anyone confirm what is happening in these months and maybe how to accommodate the 1 day difference. Does SAS have a US holilday calendar? data test; format business_day1 business_day2 business_day3 business_day4 business_day5 date9.; business_day1 = intnx('weekday', intnx('month', '23jun2024'd, 0, 'b'), 3); business_day2 = intnx('weekday', intnx('month', '18jul2024'd, 0, 'b'), 3); business_day3 = intnx('weekday', intnx('month', '06aug2024'd, 0, 'b'), 3); business_day4 = intnx('weekday', intnx('month', '11sep2024'd, 0, 'b'), 3); business_day5 = intnx('weekday', intnx('month', '25oct2024'd, 0, 'b'), 3); run;
... View more
Hello, I have a deployed SAS job runs in flow which always fails during the first run and after we re -run manually it will get succeeded. The issue is due to sql server stored procedure which we call in it in the SAS job. So we thought of adding exception handling in the schedule manager for that job. We have defined that 'if the job fails with exit code greater than zero, we asked it to re-run automatically', But its not working. Is there any other way to remove the manual process of re run ? Thanks
... View more
Hello, I was wondering if there was a way to check a range of variables to see if any are equal to a certain value.
data checks;
input check_1 $ check_2 $ check_3 $ check_4 $;
datalines;
Checked Unchecked Unchecked Unchecked
Unchecked Unchecked Unchecked Unchecked
Unchecked Checked Unchecked Unchecked
;
run;
Like for the above code, is there a way for me to test each line, and if any of the check_# variables equal to 'Checked' and save it to a new variable?
Thank you!
... View more
Obs months 1 2 2 2 3 6 4 2 I want to merge the dataset above with other datasets based on value of months variable. For example, I want to merge two months of data for the first record, two months of data for the second record, 6 months of data for the third record, and 2 months of records for the fourth record. Is there a systematic way of doing it? I was thinking about creating a variable based on the months variable and create a loop within a macro to achieve it.
... View more
I am struggling to manage files in SAS OnDemand for Academics. Among other things, I am getting a message telling me I have reached the storage limit. In an effort to free up space I have started to delete files, folders and datasets.
Do I have to delete every single file one by one? Is there a way to delete a folder that is not empty?
Is there is a trash bin I need to empty? I deleted many datasets and I'm still getting the same error message ("Your home directory is full. ".
Is there a way to determine the size of a folder or file? I'd like to find the largest folders and start there.
How can I determine how much space is currently being utilized?
Thanks.
... View more