BookmarkSubscribeRSS Feed
fongdo
Obsidian | Level 7

I would like to identify a dummy variable where 1= the company names that contain the words “America(n)” or “US(A)” and 0= otherwise. Please see a sample below:

 

Thank you very much

 

HAVE

FIRM_ID                              NAME                  

1                                          AMERICAN MOBILE SYS

2                                          GAS NATURAL INC

3                                          UNIVERSAL AMERICAN CORP

4                                          CRUISE AMERICA INC

5                                          TELECOM USA INC

6                                          GENERAL MOTORS CO

7                                          US AIRWAYS GROUP INC

8                                          HOME STAKE MINING

 

WANT

FIRM_ID                              NAME                                                                  DUMMY

1                                           AMERICAN MOBILE SYS                                             1

2                                          GAS NATURAL INC                                                       0

3                                          UNIVERSAL AMERICAN CORP                                    1

4                                          CRUISE AMERICA INC                                                 1

5                                          TELECOM USA INC                                                      1

6                                          GENERAL MOTORS CO                                               0

7                                          US AIRWAYS GROUP INC                                            1

8                                          HOME STAKE MINING                                                  0 

 

3 REPLIES 3
fongdo
Obsidian | Level 7
Thanks KurtBremser. It would be grateful if you could give me a full code?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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