Sample 51216: Prevent a carriage return at the end of a table routed to a CSV file with ODS
The CSV and CSVALL tagsets generate a line feed, or carriage return, at the end of a table. Each respective tagset definition has a NEW LINE (NL) instruction when the table finishes, specifically:
The following code creates a customized tagset, MYCSV, using the CSV tagset as the parent. The MYCSV tagset creates a CSV file without a line feed at the end of a table event.
ods path(prepend) work.template(update);
proc template;
define tagset tagsets.mycsv;
parent=tagsets.csv;
define event table;
finish: put;
end;
end;
run;
ods tagsets.mycsv file="nocr.csv";
proc print data=sashelp.class;
run;
ods _all_ close;
ods tagsets.csv file="cr.csv";
proc print data=sashelp.class;
run;
ods _all_ close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to prevent a carriage return at the end of a table routed to a CSV file with ODS.
Date Modified: | 2013-10-08 15:37:15 |
Date Created: | 2013-10-01 10:09:34 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS2M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 R2 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |
Microsoft Windows XP Professional | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 9.2 TS2M3 | |
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 9.2 TS2M3 | |
Windows 7 Professional 32 bit | 9.2 TS2M3 | |
Windows 7 Professional x64 | 9.2 TS2M3 | |
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 9.2 TS2M3 | |
Windows Vista | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | |
64-bit Enabled HP-UX | 9.2 TS2M3 | |
64-bit Enabled Solaris | 9.2 TS2M3 | |
HP-UX IPF | 9.2 TS2M3 | |
Linux | 9.2 TS2M3 | |
Linux for x64 | 9.2 TS2M3 | |
OpenVMS on HP Integrity | 9.2 TS2M3 | |
Solaris for x64 | 9.2 TS2M3 | |