{"id":423,"date":"2023-02-24T16:22:05","date_gmt":"2023-02-24T15:22:05","guid":{"rendered":"http:\/\/www.sepchat.com\/SC\/?p=423"},"modified":"2023-02-24T16:22:09","modified_gmt":"2023-02-24T15:22:09","slug":"ibm-i-clp-definition-dune-structure-de-donnees","status":"publish","type":"post","link":"http:\/\/www.sepchat.com\/SC\/index.php\/2023\/02\/24\/ibm-i-clp-definition-dune-structure-de-donnees\/","title":{"rendered":"IBM\u00a0i &#8211; CLP &#8211; D\u00e9finition d&rsquo;une structure de donn\u00e9es"},"content":{"rendered":"\n<p>Dans un CLP, il est possible de d\u00e9finir une DS comme c&rsquo;est habituellement le cas en RPG<\/p>\n\n\n\n<p>&nbsp;Par exemple, pour d\u00e9couper la variable NIR (N\u00b0 INSEE) :<\/p>\n\n\n\n<p>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;NIR)&nbsp;&nbsp;&nbsp; TYPE(*CHAR) LEN(13)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;SEXE)&nbsp;&nbsp; TYPE(*CHAR) STG(*DEFINED) LEN(1) DEFVAR(&amp;NIR&nbsp; 1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;ANNAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;MONAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;DPNAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;CMNAIS) TYPE(*CHAR) STG(*DEFINED) LEN(3) DEFVAR(&amp;NIR&nbsp; 8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;ORDRE)&nbsp; TYPE(*CHAR) STG(*DEFINED) LEN(3) DEFVAR(&amp;NIR 11)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;CLENIR) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR 14)&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>Cette fonctionnalit\u00e9 n&rsquo;est valide qu&rsquo;\u00e0 partir de la V5R4.\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>Dans un CLP, il est possible de d\u00e9finir une DS comme c&rsquo;est habituellement le cas en RPG &nbsp;Par exemple, pour d\u00e9couper la variable NIR (N\u00b0 INSEE) : &nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;NIR)&nbsp;&nbsp;&nbsp; TYPE(*CHAR) LEN(13)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;SEXE)&nbsp;&nbsp; TYPE(*CHAR) STG(*DEFINED) LEN(1) DEFVAR(&amp;NIR&nbsp; 1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;ANNAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;MONAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR(&amp;DPNAIS) TYPE(*CHAR) STG(*DEFINED) LEN(2) DEFVAR(&amp;NIR&nbsp; 6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&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\/423"}],"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=423"}],"version-history":[{"count":1,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"predecessor-version":[{"id":424,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions\/424"}],"wp:attachment":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/tags?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}