BookmarkSubscribeRSS Feed

文字変数値の中に特定の文字列が含まれているかどうかを調べる

Started ‎03-05-2018 by
Modified ‎04-19-2018 by
Views 2,924

質問

文字変数値の中に特定の文字列が含まれているかどうかを調べる方法はありますか。

回答

文字列の位置を求めるINDEX関数を使って、文字変数の中に特定の文字列が含まれているかどうかを調べられます。
含まれていた場合は開始位置が、含まれていない場合は「0」が返ります。

 

プログラム例:

 

data a; 
  x='this is a string'; 
  find=INDEX(x,'str'); 
run; 

 

この例の実行結果は「11」になります。

 

 

Version history
Last update:
‎04-19-2018 01:25 AM
Updated by:

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Article Labels
Article Tags

SAS Support Communitiesのユーザーガイドライン


コミュニティの基本的なガイドラインについてご説明します。まずは、こちらをご参照ください。

詳細を読む

 

SAS Support CommunitiesのFAQ


SAS Support CommunitiesのFAQはヘルプに記載されています。参照方法は、こちらからご確認ください。

詳細を読む

 

質問や意見の投稿と返信方法について


Japan SAS Discussionページに質問や意見(メッセージ)を投稿/返信する方法を簡単にご説明します。

詳細を読む