12-13-2015 11:44 PM
Hi, we recieve monthly data and create YTD data. Before i just had a code e.g. "DATA YTDdat; SET dJan dFeb ... dDec;RUN;". If there was no month mentioned in a SET statement, it would give me an error message, but will append all existing months all the same. Now I am creating essentially the same code, but it gives an error message e.g. "ERROR: File ONL_DEC15.DATA does not exist" but does not create a file with existing months. My question: is there a way to create YTD data automatically, depending on whether the data for a particular month exists?
12-14-2015 06:11 AM
As with anything else, I would not recommend putting "data" in the table name or table headers. Consider your approach, what happens if you get updates for a month, what happens the next year etc. Would it not be far easier to work with one large dataset which has another column:
DATE_RECIEVED Other variables...
Then each upload, you insert the new data with a given date. Then your programs can be written to just point to one dataset, and use the date variable to group. Far easier than messing around with filenames etc.
Need further help from the community? Please ask a new question.