views:

27

answers:

2

How can I export a character variable WITH trailing spaces and quotes?

eg:

data x;
format x $quote17.;
x='ruby';
put x=;
run;

(log extract)
x="ruby"

What is the most efficient way to get the following result?

x="ruby             "
A: 

found a way..

data x;
format x $19.;
x='ruby';
x=quote(subpad(x,1,17));
put x=;
run;

not sure if this is the most efficient though!

Bazil
A: 
data x;
  Format x $17. q$1.;
  x='Ruby';
  q='"';
  qxq=cat(q,x,q);
  Put qxq=;
run;
rkoopmann