{"id":417,"date":"2023-02-24T16:18:26","date_gmt":"2023-02-24T15:18:26","guid":{"rendered":"http:\/\/www.sepchat.com\/SC\/?p=417"},"modified":"2023-02-24T16:24:00","modified_gmt":"2023-02-24T15:24:00","slug":"ibm-i-clp-taille-des-donnees-dans-une-variable","status":"publish","type":"post","link":"http:\/\/www.sepchat.com\/SC\/index.php\/2023\/02\/24\/ibm-i-clp-taille-des-donnees-dans-une-variable\/","title":{"rendered":"IBM\u00a0i &#8211; CLP &#8211; Taille des donn\u00e9es dans une variable"},"content":{"rendered":"\n<p>Connaitre la taille des donn\u00e9es dans une variable RPG est assez simple en soit.<\/p>\n\n\n\n<p>R\u00e9cup\u00e9rer cette information dans un programme CLP peut s&rsquo;av\u00e9rer compliqu\u00e9.<\/p>\n\n\n\n<p>Contre toute attente, la commande RTVMSG permet de r\u00e9cup\u00e9rer la taille des donn\u00e9es dans une variable.<\/p>\n\n\n\n<p>&nbsp;Voici un exemple de code permettant de d\u00e9terminer la taille du texte \u00ab\u00a0christophe\u00a0\u00bb dans la variable &amp;TEST<\/p>\n\n\n\n<p>&nbsp;DCL &amp;TEST TYPE(*CHAR) LEN(20) VALUE(&lsquo;christophe&rsquo;)<\/p>\n\n\n\n<p>DCL &amp;LEN TYPE(*DEC) LEN(5 0)<\/p>\n\n\n\n<p>&nbsp;RTVMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&amp;TEST) MSGLEN(&amp;LEN)<\/p>\n\n\n\n<p>La variable &amp;LEN sera \u00e9gale \u00e0 10<\/p>\n\n\n\n<p>Une autre m\u00e9thode consiste \u00e0 modifier la valeur de la variable &amp;LEN comme suit :<\/p>\n\n\n\n<p>\u00a0CHGVAR\u00a0\u00a0\u00a0\u00a0 VAR(&amp;Len) VALUE(%BIN(&amp;TEST \u00a0 1 2))\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized size-full has-custom-border\"><a href=\"langages\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.sepchat.com\/SC\/wp-content\/uploads\/2023\/02\/fleche-r-edited.png\" alt=\"\" width=\"57\" height=\"57\"\/><\/a><\/figure>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex\">\n<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link wp-element-button\" style=\"border-radius:100px\">Cet article vous a \u00e9t\u00e9 utile ? N\u2019h\u00e9sitez pas \u00e0 le partager.<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Connaitre la taille des donn\u00e9es dans une variable RPG est assez simple en soit. R\u00e9cup\u00e9rer cette information dans un programme CLP peut s&rsquo;av\u00e9rer compliqu\u00e9. Contre toute attente, la commande RTVMSG permet de r\u00e9cup\u00e9rer la taille des donn\u00e9es dans une variable. &nbsp;Voici un exemple de code permettant de d\u00e9terminer la taille du texte \u00ab\u00a0christophe\u00a0\u00bb dans la [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/417"}],"collection":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/comments?post=417"}],"version-history":[{"count":1,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/417\/revisions"}],"predecessor-version":[{"id":418,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/417\/revisions\/418"}],"wp:attachment":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/media?parent=417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/categories?post=417"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/tags?post=417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}