Propcase not working

Reply
Occasional Contributor
Posts: 11

Propcase not working

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


Q3.jpg
Super User
Super User
Posts: 7,969

Re: Propcase not working

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.

PROC Star
Posts: 754

Re: Propcase not working

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;
Occasional Contributor
Posts: 11

Re: Propcase not working

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.

Super User
Super User
Posts: 7,969

Re: Propcase not working

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.

Super User
Posts: 7,808

Re: Propcase not working

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 5 replies
  • 160 views
  • 3 likes
  • 4 in conversation