DATA Step, Macro, Functions and more

case sensitivity

Reply
Occasional Contributor
Posts: 13

case sensitivity

[ Edited ]

are the variables and file names in SAS case sensitive?

 

 

data set;
    set sasdata .chemists;
    if jobcode = 'Chem2'
        then description = 'Senior Chemist';
    else description = 'Unknown';
run;

A value for the variable JOBCODE is listed below:

JOBCODE
chem2

 

output:  ?

 

 

the following file downloaded from SAS->help->learn sas programming

 

proc print data=clinic.stress2;
run;

 

/* modified file name */

proc print data=clinic.Stress2;
run;

 

output is same for both print statements

Respected Advisor
Posts: 4,654

Re: case sensitivity

[ Edited ]

Keep on experimenting! You will find that file names, library names, variable names and language elements are NOT case sensitive but that operations on string variables (e.g. name = "John") ARE case sensitive. Thus, when you want to make string operations case insensitive, you must take precautions (e.g. upcase(name) = "JOHN").

PG
Ask a Question
Discussion stats
  • 1 reply
  • 1711 views
  • 1 like
  • 2 in conversation