Hi
I have 740 firms and I want to attach dates of trading days from June 8th 2020 till July 17th 2020 with these firms. Hence, each firm needs to have a time series of daily dates (Panel data). I want to create a list of dates for these trading days in mmddyy10. format. Is there any SAS code which can help me in this regard? Thanks
I think you might be asking about an earlier part of the process ... how to create the list of dates. If that's the case, you need to know the holidays in that time period. Assuming that the only holiday is the fourth of July, you could use:
data trading_days;
do date = '08jun2020'd to '17jul2020'd;
if 1 < weekday(date) < 7 and date ne '04jul2020'd then output;
end;
format date mmddyy10.;
run;
You will need to check whether there were any other dates in that timeframe, and whether the fourth of July was actually celebrated on July 4th rather than a nearby date.
The earlier post gives you ways to combine this list of dates with your set of 740 firms.
I think you might be asking about an earlier part of the process ... how to create the list of dates. If that's the case, you need to know the holidays in that time period. Assuming that the only holiday is the fourth of July, you could use:
data trading_days;
do date = '08jun2020'd to '17jul2020'd;
if 1 < weekday(date) < 7 and date ne '04jul2020'd then output;
end;
format date mmddyy10.;
run;
You will need to check whether there were any other dates in that timeframe, and whether the fourth of July was actually celebrated on July 4th rather than a nearby date.
The earlier post gives you ways to combine this list of dates with your set of 740 firms.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.