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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.