Hi,
I have a project that I will automate annually.
I'm trying to find an efficient way to store last year (the data year) in a local macro. I have a solution but it seems inelegant. Here is my code:
local year =yofd(date("$S_DATE", "DMY"))
local year = `year'-1
di "`year'"
Is there a better way to do this? is there an $S_YEAR or something similar?
Thanks in advance!
Related Posts with Extracting last year from $S_DATE
xtabond2: question on determining appropriate lagsHi everyone, I have a panel data with n=48, T=40. The data contains people’s subjective experience …
Creating a flag variable for a time range intervalHi. I need to create a flag variable (r30) based on a time interval (TimeToClm) variable. Basically,…
Group characteristicsI would appreciate inputs on comparing characteristics of two randomized groups of patients (age, ge…
Improve your data proficiencyIndepth Research Institute a NITA certified training firm would like to inform you that it has partn…
STATA Help( rolling beta, quintile portfolio, and the regression analysis)kindly looking for help. I have a hedge fund data year 2010 to 2019 contains dates and thousand of f…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting last year from $S_DATE
Post a Comment