Search code examples
sas

Convert from char to Num a list of variables


I use the following code to add empty columns to my data set. How can I specify that they must be numeric instead of character?

Thank you in advance

       data mydb;
         set all;
           array c{54} $100;
       run;

I would like columns from c1 to c54 to be numeric. By default they are char. Thank you in advance


Solution

  • No. By default they are numeric. You set them to character with a length of 100 with the $100 part of your Array Statement.

    Simply do this to make them numeric.

    data mydb;
       set all;
       array c{54};
    run;