So, why are you removing dates from the last day of the month for just some months?
What is the magic number -9999? If it is an external value that should be missing then set it missing as early as practical.
And maybe a general description of what this code is supposed to do in narrative terms.
A few of general comments:
1) It is quite often better to separate out reading external data and generating reports. That way you can validate that your "raw" data is properly structured and has all the values you need before generating the report.
2) use of code like
DATA play;
SET play;
inside a macro means that you may never know when something went "wrong" with code. That structure completer rewrites the Play data set and you won't be able to tell if there was a problem with the source version of "Play".
3) Splitting datasets apart on the basis of a variable like your "feature" is often inefficient and makes it difficult to do some things like verify the tmin is actually less than or equal to the tmax, or calculate the daily range of temperature (guessing from the data set name "weather" and tmin, tmax variable names). If you made the dates a bit early you could sort on the date and use the Feature variable to rename the value as an ID variable in proc transpose. Allowing you to create a data set like
Year Month Date Tmin Tmax
(and if there are other measures in there like humidity, barometric pressure or similar then the other measures as well).
4) creating dates early is often a good idea as you can do lots of things with formats and or the functions like INTNX and INTCK.
5) include displayed output such as Proc Print, Proc Freq or similar only for things that you actually need. If you are doing these to verify that your "data looks good" that should be done prior to actual reporting. Which might indicate that your "macro" should be in separate parts, not an uncommon coding practice.
I might suggest posting an example of the text file you are reading so we can get a better idea of what you have. Copy 5 to 10 lines from the source and paste into a code box opened on the forum with the </> icon to preserve the text layout.
... View more