{"id":3822,"date":"2023-04-28T15:00:06","date_gmt":"2023-04-28T13:00:06","guid":{"rendered":"https:\/\/www.skillup.cloud\/?p=3822"},"modified":"2024-01-23T17:46:49","modified_gmt":"2024-01-23T16:46:49","slug":"elenco-lavori-attivi","status":"publish","type":"post","link":"https:\/\/www.skillup.cloud\/it\/elenco-lavori-attivi\/","title":{"rendered":"Elenco Lavori Attivi"},"content":{"rendered":"\n<p>Un sistema alternativo e utile per essere utilizzato al bisogno in Programmi di monitoraggio del Sistema, \u00e8 il seguente comando SQL che elenca tutti i lavori &#8220;utente&#8221; (NON di Sistema) che stanno &#8220;girando&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">SELECT&nbsp;\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_NAME, JOB_NAME_SHORT, JOB_USER, JOB_NUMBER, JOB_INFORMATION,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_STATUS, JOB_TYPE, JOB_TYPE_ENHANCED, JOB_SUBSYSTEM, JOB_DATE,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_DESCRIPTION_LIBRARY, JOB_DESCRIPTION, JOB_ACCOUNTING_CODE,\n&nbsp; &nbsp; &nbsp; &nbsp;SUBMITTER_JOB_NAME, SUBMITTER_MESSAGE_QUEUE_LIBRARY,\n&nbsp; &nbsp; &nbsp; &nbsp;SUBMITTER_MESSAGE_QUEUE, SERVER_TYPE, JOB_ENTERED_SYSTEM_TIME,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_SCHEDULED_TIME, JOB_ACTIVE_TIME, JOB_END_TIME,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_END_SEVERITY, COMPLETION_STATUS, JOB_END_REASON,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_QUEUE_LIBRARY, JOB_QUEUE_NAME, JOB_QUEUE_STATUS,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_QUEUE_PRIORITY, JOB_QUEUE_TIME, JOB_MESSAGE_QUEUE_MAXIMUM_SIZE,\n&nbsp; &nbsp; &nbsp; &nbsp;JOB_MESSAGE_QUEUE_FULL_ACTION, ALLOW_MULTIPLE_THREADS,\n&nbsp; &nbsp; &nbsp; &nbsp;PEAK_TEMPORARY_STORAGE, DEFAULT_WAIT, MAXIMUM_PROCESSING_TIME_ALLOWED,\n&nbsp; &nbsp; &nbsp; &nbsp;MAXIMUM_TEMPORARY_STORAGE_ALLOWED, TIME_SLICE, JOB_SWITCHES,\n&nbsp; &nbsp; &nbsp; &nbsp;ROUTING_DATA, CCSID, CHARACTER_IDENTIFIER_CONTROL,\n&nbsp; &nbsp; &nbsp; &nbsp;SORT_SEQUENCE_LIBRARY, SORT_SEQUENCE_NAME, LANGUAGE_ID, COUNTRY_ID,\n&nbsp; &nbsp; &nbsp; &nbsp;DATE_FORMAT, DATE_SEPARATOR, TIME_SEPARATOR, DECIMAL_FORMAT,\n&nbsp; &nbsp; &nbsp; &nbsp;TIME_ZONE_DESCRIPTION_NAME, MESSAGE_LOGGING_LEVEL,\n&nbsp; &nbsp; &nbsp; &nbsp;MESSAGE_LOGGING_SEVERITY, MESSAGE_LOGGING_TEXT,\n&nbsp; &nbsp; &nbsp; &nbsp;LOG_CL_PROGRAM_COMMANDS, STATUS_MESSAGE, INQUIRY_MESSAGE_REPLY,\n&nbsp; &nbsp; &nbsp; &nbsp;BREAK_MESSAGE, JOB_LOG_OUTPUT, JOB_LOG_PENDING, OUTPUT_QUEUE_PRIORITY,\n&nbsp; &nbsp; &nbsp; &nbsp;OUTPUT_QUEUE_LIBRARY, OUTPUT_QUEUE_NAME, SPOOLED_FILE_ACTION,\n&nbsp; &nbsp; &nbsp; &nbsp;PRINTER_DEVICE_NAME, PRINT_KEY_FORMAT, PRINT_TEXT, DEVICE_NAME,\n&nbsp; &nbsp; &nbsp; &nbsp;DEVICE_RECOVERY_ACTION, DDM_CONVERSATION, MODE_NAME, UNIT_OF_WORK_ID,\n&nbsp; &nbsp; &nbsp; &nbsp;CHAR(INTERNAL_JOB_ID) C_INTERNAL_JOB_ID\n&nbsp; FROM TABLE(QSYS2.JOB_INFO(JOB_STATUS_FILTER =&gt; '*ACTIVE', &nbsp; &nbsp;&nbsp;\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JOB_USER_FILTER =&gt; '*ALL'))&nbsp;\n&nbsp;WHERE (JOB_TYPE NOT IN('ASJ', 'BCI', 'SYS', 'PJ'))\n&nbsp; &nbsp;AND LEFT(JOB_USER, 1) &lt;&gt; 'Q'\n&nbsp;ORDER BY JOB_USER, JOB_N00001<\/pre>\n\n\n\n<p>Result:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">---\nJOB_NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOB_TYPE &nbsp;THREAD_ID &nbsp;THREAD_TYPE &nbsp;ORDINAL_POSITION &nbsp;ENTRY_TYPE &nbsp;PROGRAM_NAME &nbsp;PROGRAM_LIBRARY_NAME &nbsp;STATEMENT_IDENTIFIERS &nbsp;MODULE_NAME &nbsp;MODULE_LIBRARY_NAME &nbsp;PROCEDURE_NAME &nbsp;ACTIVATION_GROUP_NUMBER &nbsp;ACTIVATION_GROUP_NAME &nbsp;MI_INSTRUCTION_NUMBER\n190936\/USR001\/QPADEV0003 &nbsp;INT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 126 &nbsp;USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24 &nbsp;ILE &nbsp; &nbsp; &nbsp; &nbsp; QRNXIO &nbsp; &nbsp; &nbsp; &nbsp;QSYS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 63 &nbsp;QRNXWSIO &nbsp; &nbsp; QBUILDSS1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_QRNX_WS_EXFMT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 &nbsp;*DFTACTGRP\n190936\/USR001\/QPADEV0003 &nbsp;INT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 126 &nbsp;USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23 &nbsp;ILE &nbsp; &nbsp; &nbsp; &nbsp; PGM001 &nbsp; &nbsp; &nbsp; &nbsp;LIBPGM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;74400 &nbsp;PGM001 &nbsp; &nbsp; &nbsp; QTEMP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PGM001 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 &nbsp;*DFTACTGRP\n190936\/USR001\/QPADEV0003 &nbsp;INT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 126 &nbsp;USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 19 &nbsp;OPM &nbsp; &nbsp; &nbsp; &nbsp; PGM000 &nbsp; &nbsp; &nbsp; &nbsp;LIBPGM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;600 &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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15\n---<\/pre>\n\n\n\n<p><strong>Nota sul comando SQL:<\/strong><\/p>\n\n\n\n<p>Possono verificarsi dei casi in cui il comando SQL &#8220;sembra&#8221; non funzionare o peggio ancora che alcuni dati che dovrebbe estrarre non vengano &#8220;trovati&#8221;.<br>Questo succede se lo strumento con cui viene eseguito il comando SQL (STRSQL nativo AS400, strumenti esterni via ODBC, JDBC, OLEDB, ecc.) riscontra dei problemi nella conversione dei valori presenti all&#8217;interno delle varie colonne estratte (spesso dovuti a CCSID incompatibili fra Sistemi).<br>In circostanze di questo genere \u00e8 necessario individuare per tentativi quali colonne NON estrarre o tentare di estrarre effettuando la conversione a carattere con la funzione &#8220;Char(colonna)&#8221;.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"32\" height=\"32\" class=\"wp-image-3817\" style=\"width: 32px;\" src=\"https:\/\/www.skillup.cloud\/wp-content\/uploads\/2023\/11\/Actions-help-hint-icon.png\" alt=\"\">Casi in cui pu\u00f2 essere utile:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Voglio sapere quanti lavori sono attivi<\/li>\n\n\n\n<li>Voglio sapere se un lavoro \u00e8 attivo<\/li>\n\n\n\n<li>Voglio sapere se un Utente ha dei Lavori attivi<\/li>\n\n\n\n<li>Voglio vedere se un lavoro sta girando<\/li>\n\n\n\n<li>Voglio vedere se un lavoro \u00e8 finito<\/li>\n\n\n\n<li>Voglio rendermi conto perch\u00e9 il Sistema \u00e8 rallentato<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Un sistema alternativo e utile per essere utilizzato al bisogno in Programmi di monitoraggio del Sistema, \u00e8 il seguente comando SQL che elenca tutti i lavori &#8220;utente&#8221; (NON di Sistema) che stanno &#8220;girando&#8221;: SELECT&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JOB_NAME, JOB_NAME_SHORT, JOB_USER,&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[16],"tags":[29,31,40,46,74],"class_list":["post-3822","post","type-post","status-publish","format-standard","hentry","category-iniziamo-con-alcuni-esempi","tag-as400","tag-db2","tag-iseries","tag-sql","tag-job_info"],"_links":{"self":[{"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/posts\/3822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/comments?post=3822"}],"version-history":[{"count":6,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/posts\/3822\/revisions"}],"predecessor-version":[{"id":3902,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/posts\/3822\/revisions\/3902"}],"wp:attachment":[{"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/media?parent=3822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/categories?post=3822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillup.cloud\/it\/wp-json\/wp\/v2\/tags?post=3822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}