<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>no14141</author_name>
  <author_url>https://blog.hatena.ne.jp/no14141/</author_url>
  <blog_title>タイガー！タイガー！じれったいぞー！（SE編）</blog_title>
  <blog_url>https://tigertaizo.hatenablog.com/</blog_url>
  <categories>
    <anon>AS400</anon>
    <anon>RPGLE</anon>
  </categories>
  <description>自分が知らなかったことで、はまってしまったので、アップしておきます。 入力されている文字列の長さを調べる方法は、BIF関数「%LEN」で簡単に取得できるものだと思っていました。 しかし、DB2 for iでは、DDSで定義したテーブルの文字列は、CHARになるので、毎回、%LENで取得できる値は、そのフィールド長になってしまうことを最近知りました。 TRIMをかましてからLENで取得しても、値は変わりません。 そこで、「%CHECKR」という関数があるではないですか！！ 右端の文字から左に向って、指定した文字列でない最後の文字の位置を返してくれるようです。 サンプルと実行結果は、下記の通りです…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftigertaizo.hatenablog.com%2Fentry%2F2015%2F02%2F02%2F194629&quot; title=&quot;【AS400】RPGLE-有効文字列の長さを調べる方法 - タイガー！タイガー！じれったいぞー！（SE編）&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-02-02 19:46:29</published>
  <title>【AS400】RPGLE-有効文字列の長さを調べる方法</title>
  <type>rich</type>
  <url>https://tigertaizo.hatenablog.com/entry/2015/02/02/194629</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
