BookmarkSubscribeRSS Feed
epidemiologystu
Calcite | Level 5

Hello,

 

I have one variable called JOB which lists job titles. These titles are not consistent as they were completed in an open-ended survey. I'm looking to pull keywords from the job title such as "Admin" "nurse" "analyst".

 

Ultimately I want to associate these with a code so I am planning on using the IF/ THEN statements. However, first I need to extract the keyword into a new variable and I don't know how to do this. I was looking at the EXTRACT function or the SUBSTR FUNCTION.

 

Any help would be appreciated!

2 REPLIES 2
ballardw
Super User

I have worked a bit with job titles. And have seen job titles like "admin nurse" or "administrative analyst". So, what will you do with single job titles that have multiple keywords.

 

Is the search supposed to be case sensitive? Sensitive would mean that 'admin' does not match 'Admin'.

Is the search to be exact word of does matching part of a word count as found? Does 'administration' count as a match for the keyword 'admin'?

 

"Pull from" would sort of imply "remove" the keyword from the title. Is that what you want to do? Or set an indicator that the key word appears in the text of the variable?

You might find the INDEX or FIND functions more useful. These functions tell you where the value starts in a string or 0 otherwise. Attempting to use SUBSTR you have to provide start and or end parts and likely too much work to determine those.

 

It would help to provide some example data and what you would expect the result to look like for that example. It likely will help if show exactly how you intend to use the "pulled values" as well.

epidemiologystu
Calcite | Level 5

what will you do with single job titles that have multiple keywords?
This is a good point. Ultimately, these keywords are used to code indoor jobs so it won't affect the outcome as both the nurse and the analyst will be indoor jobs. However, I do want to have accurate coding and planned to review the coding done in SAS and make adjustments as needed for these situations.

 

Is the search supposed to be case sensitive? 

Is the search to be exact word of does matching part of a word count as found? 

The responses in the data are all in capital letters. Additionally, they are a mix of "admin", "administration", "administrative", etc. There are many spelling mistakes so there are some "Administratin" as well.

 

"Pull from" would sort of imply "remove" the keyword from the title. Is that what you want to do? Or set an indicator that the key word appears in the text of the variable?

I would prefer to set an indicator that the key word appears. I will look into the Index and Find functions.

 

It would help to provide some example data and what you would expect the result to look like for that example. It likely will help if show exactly how you intend to use the "pulled values" as well.
Is this an example of the job titles. Ultimately this would need to be represented by a 4-digit CCDO code. The ones listed here may technically be represented by different codes, but as they ultimately will be classified as indoor jobs this is less important. I just need to match them all to the most general account code. There are thousands of jobs listed so I wanted to bulk code some of the easier ones and manually code the more complex jobs.

ACCOUNT EXECUTIVE
ACCOUNT MANAGER
ACCOUNT MANAGER / SALES
ACCOUNT MANAGER AT A BANK
ACCOUNT MANAGER, SALES
ACCOUNT SUPERVISOR
ACCOUNTANT


This is the CCDO job titles and codes. 

Inspectors and Regulatory Officers, Government1111
Officials and Administrators Unique to Government, n.e.c.1113
Production Management Occupations1115
Management Occupations, Construction Operations1116
Inspectors and Regulatory Officers, Non-Government1119
Occupations Related to Management and Administration, n.e.c.1130

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 949 views
  • 0 likes
  • 2 in conversation