Not sure what you mean. Are you using PROC PRINT, PROC REPORT, DATA _NULL_? Are you sending output to the LISTING destination (in a mainframe job, this would be the equivalent of the SYSOUT DD location)? How are you "writing out the data"?
Given your coded approach, you will need to add a single-line PUT statement to generate a HEADER row. Your DATA step code needs to test for IF _N_=1 and issue a PUT with a text-character row surrounded with double-quotes and commas, most likely. Here's an example:
IF _N_=1 THEN PUT '"VAR1","VAR2","VAR3"';
Of course you may also want to consider the "ODS CSV" approach and use PROC PRINT.
Suggest you search the SAS support http://support.sas.com/ website for ODS CSV examples if that's your alternate approach.