BookmarkSubscribeRSS Feed
Swapnasis
Calcite | Level 5

Can u exoprt a data set without header in SAS EG?.If So,How?

2 REPLIES 2
RahulG
Barite | Level 11

Can you be more specific what do you mean when you say export dataset. 

Is it exporting flat file or is this any other file format?

 

Below is the code to import csv file without any header. You can do same thing through an EG task

proc import datafile="C:\temp\test.csv"
     out=shoes
     dbms=csv
     replace;
     getnames=no;
run;
ballardw
Super User

A dataset without headers is like a city without streetnames: How do you know where you are?

 

Export is intended for data interchange and will provide either a label or a variable name for each column of output.

 

IF you really must do this then you can use a Data step and a PUT statement to write values:

 

data _null_;

   set sashelp.class;

   file "C:\path\class.txt"; /* you may need to set LRECL to a value large enought to take all of your data in one row*/

   put @1 Name @11 Sex @11 Sex @21 Age @21 Age @31 Height @31 Height @42 weight;@42 weight;

run;

would create a fixed column file with each column starting in the position indicated by @.

Other approaches would be to create CSV by putting commas between values, or tabs

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 1367 views
  • 0 likes
  • 3 in conversation