PROC EXPORT with data that contains quotes and spaces

PROC EXPORT with data that contains quotes and spaces

Post by Lee Jenso » Thu, 14 Oct 2010 01:39:21


Hi,

I am using the following code to export data to remove the header from
the output file. My objective is to insert some XML into a little
table and export the data into a file (noheader).

proc sql;
create create table test1;
(xml char(500)
);
quit

proc sql;
insert into test1
set xml='<xxxxx yyyyyy="ALL">';
quit;

filename exTemp temp;
proc export data=test2 outfile=exTemp dbms=csv;
run;

data _null_;
infile extemp firstobs=2;
file "c:\test.xml";
input;
put _infile_;
run;


This produces an output file like this

"<xxxx yyyyyy=""ALL"">"

and I need the output to look like the original

<xxxx yyyyyy="ALL">

Please could someone assist please.

PS: If I can going about this all the wrong way then please let me
know also.

Thank You

Lee
 
 
 

PROC EXPORT with data that contains quotes and spaces

Post by Friar Broc » Thu, 14 Oct 2010 20:46:12

Quickly from memory you use:
var1 = 'xxxx yyyy'n;
(maybe that 'n' is an 's' but something close to this works)