Hi everyone,
I am trying to export a dataset without column names. So instead of:
ClientID
-----------
001234
004321
002341
It should appear as:
001234
004321
002341
I am trying to export this in a CSV format so in Excel, the first row should appear as 001234. I already tried this but it requires a name:
proc sql;
create table ID_Output as
select ClientID as " "
from raw_data;
quit;
It is easy to do it if it is just one table but I will be doing this about 30 times on each table so I was wondering if there is a way to do it? I have been trying to search with 'remove column names' or 'remove variable names' but I can't seem to find the right solution.
Any tips?
Why are you writing the header row if you don't want one?
It is actually much easier to create a delimited file without the header row than one with the header row.
data _null_;
file 'want.csv' dsd ;
set have;
put (_all_) (+0);
run;
Hi @rapt1,
Have you considered using proc export:
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n045uxf7ll2p5on1ly4at3vpd47e.htm
with the putnames=no statement:
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1oghgzuefh7oin1tpw0hodyegko.htm
Kind regards,
Amir.
Hi @Amir !
Going through the documentation, coding via proc export is not allowed at the moment. I utilize the point and click export tools of Enterprise Guide. Do you happen to know how to create a dataset with no column names so from that output, I can do the export via point and click?
Hi @rapt1,
I don't have EG in front of me at the moment, but this sounds like it might be an option that there might be a tick box for or something similar for what you need, when using point and click methods.
Kind regards,
Amir.
Why are you writing the header row if you don't want one?
It is actually much easier to create a delimited file without the header row than one with the header row.
data _null_;
file 'want.csv' dsd ;
set have;
put (_all_) (+0);
run;
Hi:
To add onto @Tom's suggestion, you could also write and submit some simple code using PROC REPORT and the NOHEADER option as shown below:
ods excel file='c:\temp\noheader_x.xlsx';
ods csv file='c:\temp\noheader_c.csv';
proc report data=sashelp.class noheader;
column name age sex height weight;
run;
ods excel close;
ods csv close;
Using ODS CSV, you can create a simple CSV file or if you want the output for Excel specifically, you can use ODS EXCEL to create an XLSX file. Use the COLUMN statement in PROC REPORT to specify the columns you want to see on the report (if you don't want to see all the columns).
Cynthia
Thanks everyone for the input!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.