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
Identify 100 biggest companies within a firmyearDear all, We are trying to generate a new dummy variable (biggest_comp_d) indicating whether a comp…
percentage of missing data for each group?Dear All, Suppose that the data set is Code: webuse grunfeld, clear set seed 1234 replace…
Robustness Check for Logistic CoefficientsDoes anyone know of a logistic coefficient robustness/sensitivity check for downloading into Stata o…
Generating the AVERAGE, by dropping Missing ValuesHello Everyone, I have Ten years of Data (2005 to 2015) for an X variable for 200 countries (data t…
Create local macro already with double quotataion marksDear Statalist I would like to create a local macro for an if-condition that already includes doubl…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting last year from $S_DATE
Post a Comment