{"id":230,"date":"2023-02-22T17:04:05","date_gmt":"2023-02-22T16:04:05","guid":{"rendered":"http:\/\/www.sepchat.com\/SC\/?p=230"},"modified":"2023-02-23T15:09:24","modified_gmt":"2023-02-23T14:09:24","slug":"sql-exporter-un-spool-au-format-pdf","status":"publish","type":"post","link":"http:\/\/www.sepchat.com\/SC\/index.php\/2023\/02\/22\/sql-exporter-un-spool-au-format-pdf\/","title":{"rendered":"SQL &#8211; Exporter un Spool au format PDF"},"content":{"rendered":"\n<p>Depuis la V 7R3, il est possible consulter la liste des fichiers spoules d&rsquo;un utilisateur grace \u00e0 une requ\u00e8te SQL<\/p>\n\n\n\n<p>Mais aussi d&rsquo;exporter un spoule au format PDF depuis une session SQL.<\/p>\n\n\n\n<p>Depuis plusieurs version IBM a ouvert SQL \u00e0 des fonctions plus orient\u00e9es syst\u00e8me.<\/p>\n\n\n\n<p>La requ\u00e8te suivante permet de lister tous les spoules d&rsquo;un utilisateur :<\/p>\n\n\n\n<p>SELECT SPOOLED_FILE_NAME,JOB_NAME,FILE_NUMBER,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; USER_DATA,STATUS,TOTAL_PAGES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp; FROM QSYS2.OUTPUT_QUEUE_ENTRIES_BASIC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;WHERE USER_NAME = &lsquo;QPGMR&rsquo;&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;<\/p>\n\n\n\n<p>A partir de l\u00e0, il est facile de r\u00e9cup\u00e9rer le d\u00e9tail du fichier et de passer la commande SQL suivante pour g\u00e9n\u00e9rer le PDF dans l&rsquo;IFS :<\/p>\n\n\n\n<p>&nbsp;VALUES SYSTOOLS.GENERATE_PDF &nbsp;<br>&nbsp;(&lsquo;767903\/QPGMR\/CPTA_MENS &lsquo;,<br>&nbsp; &lsquo;MONSPOOL&rsquo;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; 1,&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; &lsquo;\/home\/Editions\/Rapport_Compta_Mensuelle.pdf&rsquo;)&nbsp;<\/p>\n\n\n\n<p>&nbsp;Les parametres sont :<\/p>\n\n\n\n<ul>\n<li>Le job qui a cr\u00e9\u00e9 le spoule,<\/li>\n\n\n\n<li>Le nom du fichier spoule,<\/li>\n\n\n\n<li>Le num\u00e9ro du fichier spoule,<\/li>\n\n\n\n<li>Le chemin et le nom du fichier PDF en sortie.\n<ul>\n<li><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized size-full has-custom-border\"><a href=\"windows\"><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>Depuis la V 7R3, il est possible consulter la liste des fichiers spoules d&rsquo;un utilisateur grace \u00e0 une requ\u00e8te SQL Mais aussi d&rsquo;exporter un spoule au format PDF depuis une session SQL. Depuis plusieurs version IBM a ouvert SQL \u00e0 des fonctions plus orient\u00e9es syst\u00e8me. La requ\u00e8te suivante permet de lister tous les spoules d&rsquo;un [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/230"}],"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=230"}],"version-history":[{"count":4,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":351,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/230\/revisions\/351"}],"wp:attachment":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}