DATA Step, Macro, Functions and more

Comparing Two strings

Reply
Occasional Contributor
Posts: 7

Comparing Two strings

Data set = mydata

 

I need to compare column1 and column2 and create a column3 that gives me which comes first alphabetically. Example:

 

Column1 = San Francisco

Column2 = San Diago

 

Column3 would = San Diago becaue San Diago comes before San Francisco alphabetically. How can I dio this?

Contributor hbi
Contributor
Posts: 66

Re: Comparing Two strings

Posted in reply to Mattress58
Super User
Posts: 19,855

Re: Comparing Two strings

Posted in reply to Mattress58
You can view your previous questions by going to the top right corner, clicking on your icon and looking at your profile.
Ask a Question
Discussion stats
  • 2 replies
  • 989 views
  • 0 likes
  • 3 in conversation