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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1093 views
  • 3 likes
  • 4 in conversation