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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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