# DS2関数(文字列)

# 文字列の長さを取得する

<details><summary>LENGTH関数</summary>

``` sas
val = length(str);
```

...

<https://documentation.sas.com/doc/ja/pgmsascdc/v_061/ds2ref/n1lbye3jnh3aipn16jqqkbv4gnsg.htm>

</details>

# 文字列中の指定文字列の位置を取得する

<details><summary>FIND関数</summary>

``` sas
pos = find(string, substring);
pos = find(string, substring, startpos);
```

...

<https://documentation.sas.com/doc/ja/pgmsascdc/v_061/ds2ref/n1v0tzf4xq363mn15mnppqtk2zti.htm>

</details>

# 入力された文字列を区切り、n番目の単語を取得する

<details><summary>SCAN関数</summary>

`str = scan(input_str, n, delimiter);`

<https://documentation.sas.com/doc/ja/pgmsascdc/v_061/ds2ref/p13adatt2vvhcxn1ext6w6eet24p.htm>

</details>