The SAS Output Delivery System and reporting techniques

why is CSV destination slower than HTML ?

Posts: 0

why is CSV destination slower than HTML ?

we have experienced considerably greater CPU time and elapsed time when using ods csv and proc print than when using an internally created macro for building a csv file.
DATA : 18,500 rows 30 columns
platform: SAS9.1.3 sp4 on z/OS V01R08M00
times :
ODS CSV 40+secs CPU, 6+mins elapsed
macro <1sec CPU <2secs elapsed

I'm surprised that the ODS destination is using so much processing.

For the HTML destination, the proc print times are
1.6 secs CPU
26.2 secs elapsed.

Why would HTML be so much quicker than CSV?
What is going on "under the covers"?

Posts: 8,743

Re: why is CSV destination slower than HTML ?

Hi, Peter:
Have you checked out this Tech Support note:

...and downloaded a new version of the CSV tagset? It may be that your process will -still- work faster -- because you KNOW exactly how you want things to be written and ODS CSV still has some internal checking that it does.

The note considers the problem fixed at SAS 9.2 -- so if you're at SAS 9.13 or SAS 8 on the mainframe, you may want to talk to Tech Support to see if there are any other suggestions they have for performance improvement.

Posts: 0

Re: why is CSV destination slower than HTML ?


thank you
I'll look at how the tagset code varies.
We "had a bit of trouble" implementing the updated excelXP so I'm only going to follow that route for CSV if it is really beneficial versus the hassle of coping with NLS issues for perl regex.
What I find hard to understand is the complexity.
We use default formats as defined in the SAS data set header.
We use the variable order as proc print would produce without a VAR statement....
We are using defaults all the way.
Clearly the tagset is doing much more for us.

Hopefully, the updated tagset will perform with run times more like the HTML destination.

I've referred this thread to our UK Tech Support to clarify SAS92 availability for our z/OS.

Posts: 8,743

Re: why is CSV destination slower than HTML ?

Hi, Peter...

Yes...but PROC PRINT is adding a layer of "reporting" between the data set and the output destination -- even if you're taking all the defaults.

The complexity comes in because a dataset can't have a PROCTITLE, a dataset can't have a SAS Title or a SAS Footnote or a BYLINE or a SUMBY or a BY and a PAGEBY. A dataset doesn't have the potential for page numbers on each page. So, ODS CSV, even if it's going to ignore many of these features of PROC PRINT, still has some checking that it does...that's related to

So even though it seems like there's no difference between PROC PRINT and PROC EXPORT to CSV, there is a difference...and it's the difference between DATA and REPORTS. I know that the tagset is doing more behind the scenes -- for example, if you have a formatted value that might give Excel fits, then I believe that ODS CSV strips out offending characters. Sometimes, for example, you have a field that's numeric, but with a % or a $ in the field, Excel treats the number as a character and it gives you that funny green triangle in the cell. Those are some of the things that ODS CSV is trying to fix for you. I know that newer versions of the tagset do the checking in different ways.

I don't actually know _all_ that the tagset is doing, just what I've experienced in using it. Most of the time, I use TAGSETS.EXCELXP.

Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation