BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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;

PaigeMiller
Diamond | Level 26

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

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 863 views
  • 0 likes
  • 2 in conversation