comp.soft-sys.sas - The SAS statistics package.
Hi Folks! SAS Ver8.2 Win2000 I am importing an MS Access97 data table with the following code; PROC IMPORT OUT= WORK.TEST DATATABLE= "TEST _OUTPUT" DBMS=ACCESS97 REPLACE; DATABASE="\\james\SAS_INPUT\data_ms_access97.mdb"; RUN; Problem is that one of the comment fields allows multi-lines. When SAS reads the data in I get an odd symbol representing the carriage return in the value. It looks like two pipe symbols together '||' only bold and somewhat smaller? I would like to use the following code to replace the symbol with a space. comment=translate(comment,'','|'); How do I get SAS to display that character? Better yet how do I get SAS to replace a carriage return with a space in place of a symbol when importing? A search of the archives didn't help... TIA James
Hello, I would like to print a variable that contains 2 carriage returns and have it actually execute the carriage returns so that there are 3 lines for that 1 observation. How can this be accomplished? Thanks. data test; line1= 'line1'; line2= 'line2'; line3= 'line3'; text= cat(line1,'0D0A'x,line2,'0D0A'x,line3,'0D0A'x); run; proc print data=test; run;
Hi, I have some raw data files (CSV) which use the pipe character ('|') as the delimiter. No problems reading these into SAS - just use the DLM='|' option. However, some of the fields have embedded carriage return / line feed characters in them. SAS appears to think that this indicates a new observation when in fact it does not. The following code simulates the problem (much simplified - just a few records): data one; infile datalines dlm='|' dsd truncover; input var1 :$25. var2 :$4. var3 :$500. var4 :ddmmyy10.; format var4 ddmmyy10.; datalines; This is text|123|XXXXXXXXXXXXXXXXXXXXXXXXXXXXX|10/12/2004 This is more|9999|YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYY|25/12/2003 And some more|789|ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ|14/02/1999 ; run; I shoud have a data set here with 4 variables and 3 observations. However, because of the embedded hard return in the second row of data, I get four rows and the middle two rows are incorrectly read. Is there any way I can tell SAS to say ignore the carriage return and read in everything between the 2nd and 3rd delimiter ? I have searched this group and I see that it appears to be a common problem that no one appears to have addressed adequately. My data is very structured apart from these line breaks ? Any help greatly appreciated. Thanks, Tony
Dear all, I have a SAS dataset that I would like to put into excel without the carriage return skipping to the next line, but I would still like the alt+enter carriage return to occur within the cell. I have tired doing a find/replace by putting into excel the sting <cr> and then replacing it with the '0d'x, but at that point excel just recognizes it as a string of caracters and not a carriage return. Any suggestion? Thanks, Erick