Help using Base SAS procedures

how to see data going to ouput while debugging?

Reply
New Contributor
Posts: 4

how to see data going to ouput while debugging?

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.

Thanks

Super User
Posts: 19,869

Re: how to see data going to ouput while debugging?

I usually prefer a manual debugging process that uses put statements instead of the debugger.

Frequent Contributor
Posts: 117

Re: how to see data going to ouput while debugging?

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.

Super User
Super User
Posts: 7,993

Re: how to see data going to ouput while debugging?

Hi,

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.

New Contributor
Posts: 4

Re: how to see data going to ouput while debugging?

Thanks to all responses!

Ask a Question
Discussion stats
  • 4 replies
  • 207 views
  • 6 likes
  • 4 in conversation