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?

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
  • 3 replies
  • 999 views
  • 0 likes
  • 2 in conversation