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

Data Florida;
set work.projectdat;
if State_Province_Of_Loss= 'FL';
/*if Recordable='Yes';*/
run;

 

Hello, is anone else having issues with the new SAS stuff. I reuploaded my codebook and related files but for some reason my code isn't working like it did before. The if statement in particular. I can see the variable in the uploaded data but when I try to perform this action it doesn't work. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Go to your autoexec. Add this line of code, save the file and then restart & re-run everything.
Or put it at the top of your program to try it first.

options validvarname=v7;

View solution in original post

9 REPLIES 9
FrustratedBio
Calcite | Level 5
The varible name in excel is State/Province of Loss.
Kurt_Bremser
Super User

The first NOTE tells you that the variable is not present in the dataset. If you work with VALIDVARNAME=ANY, the import will keep the original name, which means you have to use a name literal:

'State/Province of Loss'n

 

FrustratedBio
Calcite | Level 5
this is the problem. A variable name that used to work before their update, now when ran produces no data. Makes no sense. I can get the data uploaded but can't manipulate it.
Reeza
Super User
What does your log show? What happens if you run a proc contents on your input data set?

Did you re-setup any autoexec that you may have set in SAS UE? Such as options validvarname?
FrustratedBio
Calcite | Level 5
The proc contents step runs as normal. Same number of observations, same everything. I'm having problems with variables name "X"_"X"....which until the update was the way I believed I was supposed to format multi-word variable names. Like I said, it worked perfectly before the update.
Reeza
Super User
Go to your autoexec. Add this line of code, save the file and then restart & re-run everything.
Or put it at the top of your program to try it first.

options validvarname=v7;
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
  • 9 replies
  • 3345 views
  • 0 likes
  • 3 in conversation