it is very very slow.
ODS CSV file="/ww/list.csv";
proc report data=temp;
columns customer_id;
define customer_id/display " customer_id";
run;
ODS CSV close;
any help?
Data steps still work with lots of variables, you can use formats and control the output. PROC EXPORT works, assign formats in the DATA step. Also, ODS CSV plus PROC PRINT works.
PROC REPORT is designed to make complicated reports, not appropriate for CSV files.
Why so complicated?
data _null_;
set temp;
file "/ww/list.csv";
if _n_ = 1 then put "customer_id";
put customer_id;
run;
No ODS or any output-creating procedure involved.
You can use formats in the data step; alternatively, PROC EXPORT will create DATA step code for you.
Data steps still work with lots of variables, you can use formats and control the output. PROC EXPORT works, assign formats in the DATA step. Also, ODS CSV plus PROC PRINT works.
PROC REPORT is designed to make complicated reports, not appropriate for CSV files.
@walterwang wrote:
It is a very big file. a lot of columns. I want to use format to control the output.
You need to provide a better example of your code then. How many observations in the dataset? How many variables?
What do you mean by "use format"?
A CSV file has no "format". It is just a text file.
Normal CSV file generation will use the formats attached to the variables to display the values. If you want to display some of the values with a different format than is what is normally attached to the variable then perhaps you could just write the CSV with a data step and include a FORMAT statement in the data step.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.