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

I am using a proc format statement with a "value" to recode some words in each a variable column. It is a large data set so I will show an example of my code below.

Proc format library=example;

value $catjt    'California', 'Texas', 'Nevada', 'Ohio' = 'USA';
Run;

PROC FREQ DATA=example.dsets;
tables cat
run;

Again This is just an example because the data is so large but in my frequency table the states such as "Nevada" and "Ohio" have not been changed to "USA" and I check my log and there are no errors at all. What could be the problem?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Is it possible in the data set you are working with, Nevada is actually NEVADA (uppercase)? Your format won't work on uppercase character strings.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Is it possible in the data set you are working with, Nevada is actually NEVADA (uppercase)? Your format won't work on uppercase character strings.

--
Paige Miller
superman1
Fluorite | Level 6
Oh well yes I should of specified alittle more, NEVADA and OHIO are both uppercase. I also have another state which is NEW YORK and that wont change to "USA" in my proc formats statement. What should I do then?
superman1
Fluorite | Level 6
thank you I was able to solve it with some of your advice

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 672 views
  • 0 likes
  • 2 in conversation