BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rapt1
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

 

View solution in original post

7 REPLIES 7
rapt1
Obsidian | Level 7

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?

 

 

Amir
PROC Star

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.

Sajid01
Meteorite | Level 14

Hello @rapt1 
While SAS EG can export to csv, but there is no option for removing column names.
Proc export as suggested by @Amir or your own code may be the options you have.

Tom
Super User Tom
Super User

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;

 

Cynthia_sas
SAS Super FREQ

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

rapt1
Obsidian | Level 7

Thanks everyone for the input!

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 4445 views
  • 7 likes
  • 5 in conversation