—•Today is •—

Translating a program is a SAS® function that makes it work about the same way in a different programming language. This is a simple routine to add into your program to write data to a comma delimited file for importing into a Microsoft Access or Excel table. The TRANSLATE function converts non-numeric fields for commas and replaces blank spaces.


	data tableout (drop=n);
	  set carlo.ais;
	  array t(*) _character_;
	  do n=1 to dim(t);
	    t(n)=translate(t(n)," ",",");
	  end;
	run;

	filename fileout 'c:\tblout.csv';

	proc export data=tableout dbms=csv
	        outfile=fileout replace;
	run;
				

Print Document

Copyright © 2002-2004 www.nycinformatics®.com All Rights Reserved
Last edited on: May 28, 2006
SAS product or service names are registered trademarks of SAS Institute, Inc. in the USA and other countries.
® indicates USA registration.