10-22-2012 06:55 PM
I need to export a dataset adding an additional row to the data (csv file). For example, the dataset looks like this
I want to export the dataset with an additional row before the heading, so it will like:
is there a way to do this?
10-22-2012 07:48 PM
Not quite point and click, but you could insert some code like that found at:
Just before where the code has you "put" the variable names, you could have it "put" your initial string.
10-22-2012 08:01 PM
Tried this before. The thing is I am running the process in SAS EG from a SAS server, not from local. so when I wrote data _null_, put, it always complained about Insufficient authorization to access
10-22-2012 08:45 PM
if you run an export where are the files written? Just indicate the same location (directory) in your file statement. You have to have write ability somewhere.
10-22-2012 09:38 PM
In addition to the other suggestions, instead of doing an EXPORT, using PROC EXPORT or the LIBNAME engine, you could use PROC REPORT and ODS (ODS CSVALL or ODS CSV). In the code below, I show ODS CSVALL (which would also put a SAS title into the output file).;
infile datalines dlm=',';
input item $ price : comma.;
ods listing close;
ods csvall file='c:\temp\something.csv';
proc report data=testdata nowd;
column ('purchaselist' item price);
format price dollar3.;
ods csvall close;