BookmarkSubscribeRSS Feed

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

Started ‎03-05-2018 by
Modified ‎04-19-2018 by
Views 5,860

質問

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

回答

文字列の位置を求める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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

Register now

Article Labels

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


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

詳細を読む

 

SAS Support CommunitiesのFAQ


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

詳細を読む

 

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


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

詳細を読む

Article Tags