10-05-2017 09:18 AM
I need to modify an old program. It uses around 4000 lines of codes to gather data from many datasets. I am quite sure there is a better way to do this.
To gain time, I would like profit from the expertise of the SAS experts and pick directly the best method to gather data from many datasets to produce a pdf report at the end. It also could be a global table.
Could you share your suggestions with me?
10-05-2017 09:34 AM
Really going to be hard to give any information here. No idea what any of that data format is, what mapping processes need to be done it, what outputs need to be, what systems we are talking about etc. I would suggest you start by mapping out, in a migration document, all the various input types (CSV, Excel, databases etc.) what attached documentation you have for them, i.e. specifications you have on those datasets for format etc. Then look at the code, review what is needed, assess newer methodologies for importing data etc.
Migrating existing code is not as simple as just changing some things, re-validation and testing, documentation, user notification and training etc.
10-05-2017 11:06 AM
Sometimes you can and sometimes you can't. I lean towards the second if it's data different data sets.
First, evaluate and document the input data. If the input data cannot be combined somehow it's unlikely you can improve this process.
Second, look at the code. Are there repetitive sections? If so, you can look at either creating a macro or simplifying somehow...
Third, document your requirements and start a design from scratch. Evaluate how much time your conversion/modifications will take to see if it's worth the effort first.
10-05-2017 11:29 AM
- know your data. Get a grip on input structures, see where they are similar, so you can identify spots to re-use code
- know your code. Bring it into solid visual form, so you can get a grip on the logic. Good formatting makes identifying repeating or repeatable sections of code easier
Once you have solved these two points, you can decide if there is room for optimization, and where. For how, you can get back here.