Statistical programming, matrix languages, and more

Why does IML give me CAPITAL letters?

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,800
Accepted Solution

Why does IML give me CAPITAL letters?

This code

ods listing;

proc iml;

names = {Jenny, Linda, Jim, Samuel};

print names;

quit;

ods listing close;

produces output with capital letters, why?

The SAS System 

names

JENNY
LINDA
JIM
SAMUEL


Accepted Solutions
Solution
‎05-07-2015 09:36 AM
SAS Super FREQ
Posts: 3,637

Re: Why does IML give me CAPITAL letters?

When you specify a matrix of character values, use quotes if you want to preserve case. Otherwise the values are UPCASEed. So to preserve case, use

names = {"Jenny", "Linda", "Jim", "Samuel"};

If you read data from a data set, you'll automatically get whatever case is in the data:

use sashelp.class;

read all var {"Name"};

close sashelp.class;

print Name;

View solution in original post


All Replies
Solution
‎05-07-2015 09:36 AM
SAS Super FREQ
Posts: 3,637

Re: Why does IML give me CAPITAL letters?

When you specify a matrix of character values, use quotes if you want to preserve case. Otherwise the values are UPCASEed. So to preserve case, use

names = {"Jenny", "Linda", "Jim", "Samuel"};

If you read data from a data set, you'll automatically get whatever case is in the data:

use sashelp.class;

read all var {"Name"};

close sashelp.class;

print Name;

Trusted Advisor
Posts: 1,800

Re: Why does IML give me CAPITAL letters?

Well, thanks, I doubt I would have found that in the help files.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 301 views
  • 0 likes
  • 2 in conversation