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
Weighting with mixed commandHello, I am trying to weight observations when estimating growth models in Stata, and I am having t…
Issues with legend when exporting graphs as pdfHi, When I export the following graph to pdf, the legend section is getting distorted. I am using S…
From unbalanced to balanced panel data setDear all, I have an unbalanced panel dataset, which means that not all entities have data for all y…
spmap code gives me no basemap data error despite data having _ID _CX _CY variablesHello, My current dataset for each county has _ID _CX _CY variables except for few counties. My mai…
Obtain the timestamp of a fileI am seeking guidance about how to fetch the timestamp of a file from the file system. Searches with…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting last year from $S_DATE
Post a Comment