SET PAGESIZE 0;
SET LINESIZE 1000;
SET TRIMSPOOL ON;
SET TERMOUT OFF;
SET TIMING ON;
spool output.csv;
SELECT ‘"’||col1||’","’||col2||’"’ FROM table;
spool off;
quit;
set echo off;
set heading off;
set feedback off;
set linesize 2000;
set term off;
set long 2000;
spool d:\out_put.csv;
select ‘"’||hs_res_no||’","’||acc_balance
FROM (select * from table t where t.id=’’
order by t.id);
spool off;