Hello,
I realized that people with middle names or suffixes in my data, i.e.: "Jane Doe PHD" or "Bob Scott Jr" are getting their data pushed so that for only these people, all of their data is being shifted one column to the left. This is only happening to these people, and my dataset comes from an outside source library (and cannot changed from the source). The solutions I've seen are mainly related to changing data when you in the infile statement when you load the data in, which is not possible for me. Let me know, thanks!
Again, I want to do something like this :
if index(First_name2, "JR" "PHD") then [SOMEHOW-SHIFT-LEFT COLUMNS 4 THRU 11];
Hi @claremc
We need a listing of the variable attributes, because values should be moved from one variable to another, so differences in variable lengths and types might be a problem. So please submit the code "proc contents data=mylib.myinput; run;" and post the result.
It would also be a help to have a data sample, ex. the result of "proc print data=mylib.myinput(obs=10); run;".
And a tip: To check for the occurrence of texts like "JR" or "PHD" is not the best way of finding the erroneus observations. It would be better to look at the variables 5-11 to see if a zip-code or other easily recognizable value is present in e.g. v8 or v9, or to check for non-missing values in v11, but that would only work if there are non-missing values in all observations.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: