Discussion:
Problem with ODS CSV
(too old to reply)
François
2007-06-19 19:06:20 UTC
Permalink
Hi all,

I am using ODS CSV with proc print (Sas 8.2) to create CSV files with
the labels as names of columns.

Each file has two empty lines at the beginning.

Does anybody know how to avoid those two first lines ?

Thanks,
--
François L
Robert Bardos
2007-06-20 08:02:42 UTC
Permalink
-----Urspruengliche Nachricht-----
François
Gesendet: Dienstag, 19. Juni 2007 21:06
Hi all,
I am using ODS CSV with proc print (Sas 8.2) to create
CSV files with the labels as names of columns.
Each file has two empty lines at the beginning.
Does anybody know how to avoid those two first lines ?
Can you give us some sample code, François?

I tried

ods listing close;
ods csv body='c:\temp\sasl_print.txt';
proc print data=sashelp.class;
run;
ods csv close;
ods listing;

and didn't get those empty lines.
(Tested with SAS 9.1.3 on a Win2k machine)


Robert
François
2007-06-20 17:23:27 UTC
Permalink
Post by Robert Bardos
Can you give us some sample code, François?
I tried
ods listing close;
ods csv body='c:\temp\sasl_print.txt';
proc print data=sashelp.class;
run;
ods csv close;
ods listing;
and didn't get those empty lines.
(Tested with SAS 9.1.3 on a Win2k machine)
Hi,

Thanks

I tried with 8.2 on a Unix Server

ods csv file = "%sysfunc(pathname(work))/test.csv" ;
proc print data = mydata noobs label ;
run ;
ods csv close ;

and then proc download to get the file on my computer.

I also tried with 8.1 on XP PC

ods xml file= "c:\temp\test.csv" type=csv ;
proc print data = mydata noobs label ;
run ;
ods xml close;
--
François L
Gerhard Hellriegel
2007-06-20 13:30:44 UTC
Permalink
Don't know wether that does anything:
What about options nonumber; and a empty TITLE; statement? Maybe SAS
removes that default things, but leaves the blank lines instead?
Ok, might be also a 8.2 "feature", but try it out!
Gerhard
-----Urspruengliche Nachricht-----
Fran篩s
Gesendet: Dienstag, 19. Juni 2007 21:06
Hi all,
I am using ODS CSV with proc print (Sas 8.2) to create
CSV files with the labels as names of columns.
Each file has two empty lines at the beginning.
Does anybody know how to avoid those two first lines ?
Can you give us some sample code, Fran篩s?
I tried
ods listing close;
ods csv body='c:\temp\sasl_print.txt';
proc print data=sashelp.class;
run;
ods csv close;
ods listing;
and didn't get those empty lines.
(Tested with SAS 9.1.3 on a Win2k machine)
Robert
François
2007-06-20 17:16:11 UTC
Permalink
Post by Gerhard Hellriegel
What about options nonumber; and a empty TITLE; statement? Maybe SAS
removes that default things, but leaves the blank lines instead?
Ok, might be also a 8.2 "feature", but try it out!
Hi,

Thanks, I'll try it tomorrow (I'm at home now) but I doubt !
--
François L
Robert Bardos
2007-06-21 09:31:47 UTC
Permalink
Still no answer here. Just wanted to inform that I can reproduce
the dataset having the two superfluous and unwanted blank lines up
front on a z/OS system with SAS 8.2 by using

ods listing close;
ods csv file = "&test_dataset" rs=none;
proc print data = sashelp.class(obs=3) noobs label ;
run;
ods csv close;

Adding a "title;" statement or options like nodate, nonumber,
skip=0 didn't change anything. (rs=none BTW stands for
record_separator=none. Without this there were x'15's inserted and
all was in a single record/row.)

Robert
-----Urspruengliche Nachricht-----
François
Gesendet: Mittwoch, 20. Juni 2007 19:23
Post by Robert Bardos
Can you give us some sample code, François?
I tried
ods listing close;
ods csv body='c:\temp\sasl_print.txt';
proc print data=sashelp.class;
run;
ods csv close;
ods listing;
and didn't get those empty lines.
(Tested with SAS 9.1.3 on a Win2k machine)
Hi,
Thanks
I tried with 8.2 on a Unix Server
ods csv file = "%sysfunc(pathname(work))/test.csv" ;
proc print data = mydata noobs label ;
run ;
ods csv close ;
and then proc download to get the file on my computer.
I also tried with 8.1 on XP PC
ods xml file= "c:\temp\test.csv" type=csv ;
proc print data = mydata noobs label ;
run ;
ods xml close;
--
François L
François
2007-06-22 16:02:24 UTC
Permalink
Post by Robert Bardos
Still no answer here. Just wanted to inform that I can reproduce
the dataset having the two superfluous and unwanted blank lines up
front on a z/OS system with SAS 8.2 by using
Hi,

... and the answer is

http://support.sas.com/rnd/base/topics/templateFAQ/Excel1.pdf

(works with 8.2)

quickly found thanks to

http://datasteps.blogspot.com/2007/03/sas-programming-google-search.html

in Stephen's blog
--
François L
Continue reading on narkive:
Loading...