Q: If you want to execute a piece of SAS code only on the first Friday of every month, how will you achieve it? Write a sample code (in SAS) for the same.
A: I suppose most schedulers has this functionality. But if you want to implement it using SAS, I suggest that you take a look at macro programming, together with the DAY and WEEKDAY functions.
This shows a particular report being submitted when the month is 6, 7 or 8 using a SAS Macro program. Your code would need to find and define a different date interval (probably using SAS functions)....but the overall approach would be similar.
I do suggest that you make sure you understand the code in steps 1-8 before jumping into step 9.
Depending on your OS, there is likely an option for scheduling a "task" which would be to launch SAS and pass it your SYSIN which would contain the SAS program you want to execute.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search argument, this topic/post:
Question is if you want to execute a complete program on Friday or just a section of code in a program only on Friday.
For the first you need a scheduler in your operating system.
For the second I would suggest some macro code.
data date_parms;
dow=put(today(),weekday1.);
call symputx('dow',dow);
run;
Macro variable dow is the day of week. Friday is day 6. Within the macro program you would use the following code.