03-23-2015 08:37 PM
I wonder if I can see data going to an output file during each iteration while debugging. Using DEBUG option allows me to see what is going on during each iteration but I can’t see which data got written to an output file during each iteration.
I am taking SAS class but I can’t find an answer yet…I think it is important to know as some programs include more complex options like looping, retaining, output, @ or @@ etc.
03-24-2015 05:09 AM
As you enter into debugging , you can see the iterations step by step which does by PDV. But i think you can't able to see the output data as the data set is incompleted. Each iteration will give you one output record, once these iterations completed then you can able to see the data.
03-24-2015 06:17 AM
I would suggest that you create a dataset rather than looking at each row. The reason being is that in general you will be applying logic to each and every observation. Whilst it may seem beneficial to look at each observation each time if your dealing with very small datasets, once you get to bigger ones, merges etc. then it will become quite difficult. Its generally pretty easier to see what is right/wrong in a dataset just by looking at it, for any specific thing, as Reeza has mentioned, there is the put statement.
You also mention "data got written to an output file" as something you want to see. I would suggest that you want to get your dataset one step away, i.e. get the dataset as you want then use basic output routines. The reason is, depending on the output destination you may have markup or output specific things which you wouldn't want to see whilst getting your data running.
So keep it simple for the time being, datastep at a time, create what the output should look like then simple output procedure. Examine datasets at each point. As for looping/retaining, just don't drop the variables from the dataset and you can then see them as well.