SAS Code Fragments
Changing the length of a character variable

* x has a length of 20 here;
data test1;
  input x $20. ;
cards;
abc
def
ghi
jkl
;
run;

proc contents data=test1;
run;

* we can use the "length" statement to change its length to 3;
data test2;
  length x $ 3;
  set test1;
run;

proc contents data=test2;
run;

How to cite this page

Report an error on this page or leave a comment

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.