comp.soft-sys.sas - The SAS statistics package.
I am pretty sure the offending character is '0A'x. It is inserted into the comment field in EXCEL by <ALT><ENTER> key combination, to produce a new line in a cell. You can easily translate it in your SAS program to a blank using the translate function. comment = translate(comment,' ','0a'x); On Fri, Apr 11, 2008 at 12:41 PM, < XXXX@XXXXX.COM > wrote: > I had a table in Excel which included an ID (identification number), > COMMENTS, and AMOUNT column. The COMMENTS column were text notes (up > to 2000 characters) commenting on the corresponding ID. I imported > this table (via proc import) into a SAS dataset and then used the file > and put statements to write the dataset to a fixed-length text file > (i.e., for each record, the ID variabe was outputted to positions 1-4, > COMMENTS outputted to positions 6-2005, and the AMOUNT column > outputted to positions 2007-2012). > > The text file, however, did not come out how I expected because some > of the text in the COMMENTS field wrapped over to the next line in the > text file (each record is supposed to appear on only one line in the > text file, not multiple lines). When I looked into the COMMENT field > in the SAS dataset I created, I noticed some tiny black, rectangular > symbols that appeared sporadically > throughout some of my records. I'm assuming those symbols represent a > carriage return/newline character (I don't know what the exact > terminology is for it)?? I noticed that wherever those symbols > appeared in the SAS dataset is where the text file broke to a new line > when the dataset was written to the text file. Is it possible to > eliminate this carriage return (or whatever it's called) symbol is > SAS? For my text file to be correct, I need to have each dataset > record appear on only one line in the text file and it appears as > though it is this carriage return which is making some of the comments > in my dataset to break to unexpectedly break to the next line in the > text file... >
I need to put carriage returns at the end of each record when I export a file. Currently, I'm using proc export; however, the software I am reading the data into says that I don't have carriage returns. How do I put carriage returns at the end of each record when I export. PROC EXPORT DATA= datafile OUTFILE= "c:\temp\datafile.csv" DBMS=CSV REPLACE; RUN; Thanks in advance, Brad
Is it possible to cause a carriage return when using the ANNOTATE %LABEL macro, or the equivalent in ANNOTATE commands? For example, thinking that '0D'x was a carriage return, I tried %label(x,y,"Line 1"||'0D'x||"Line 2",black,0,0,3,simplex,5) but that didn't work. Is this possible to do?