Abhishek Sharma
Abhishek Sharma

Reputation: 1

I am trying to modify and make permanent changes in the SAS data set, but I am not able to do so

I want to make permanent changes is the variable name Fclass and label Date as Departure date. i have used the modify statement along with rename but I am getting error when I am running the program.

proc datasets library= ia;
modify passngrs;
rename FClass= First Class;
label Date='Departure date';
format Date date9.;
run;

Upvotes: 0

Views: 53

Answers (1)

Richard
Richard

Reputation: 27498

You might want to do any of these:

  • Rename to a variable name that does not contain a space
    rename FCLASS = FirstClass;
  • Rename to a trickier name by using session options and a name literal
    options validvarname=any; proc ...; ...; rename FCLASS = 'First Class'N;
  • Use a label for FCLASS instead of renaming it
    label FCLASS = 'First Class';

Upvotes: 1

Related Questions