BookmarkSubscribeRSS Feed
manish_1
Fluorite | Level 6

I am attaching the snapshot of Data, Program and Log. Kindly tell me why the propcase is not working.


Q3.jpg
5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

A picture is useless to us.  Post test data in the form of a datastep so we can run something.  This works fine:

data want;
  abc=propcase("hello world");
run;

So the question is what are you running/doing that doesn't work.  We cannot tell this from what you post, test data and your code so we can run it would help.

PeterClemmensen
Tourmaline | Level 20

Are you able to run this bit of code or does it give you the same error?

 

data test;
	var = Propcase('hello');
	put var;
run;
manish_1
Fluorite | Level 6

My Program

 

data sasdata.charfuntion;
infile "F:\Char function.txt" firstobs=2;
input Fname $ Lname $ Number;
Name1=Upcase(Fname);
Name2=Lowcase(Lname);
Name3=Propcase(Name2);
run;

------------------------------------------------

 

Attaching the data also.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Works fine for me:

data want;
  input fname $ lname $ number;
  name1=upcase(fname);
  name2=lowcase(lname);
  name3=propcase(name2);
datalines;
Amit Singh 4132
Rahul Kumar 9166
Saurabh Sharma 9354
;
run;

Try starting a new session and just running the above.  Also, please specify what software you are using, it looks like Version 8 of SAS, and also you don't seem to have activated your Windows - which arouses my suspicions of what software (legal or otherwise) you are using.

Kurt_Bremser
Super User

That is a consequence of using stone-age software. SAS 9.0 stems from 2004(!), propcase() was introduced in SAS 9.1.

Upgrade to the current version ASAP.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1504 views
  • 3 likes
  • 4 in conversation