Si vous avez un commentaire ou si vous avez un truc ou une astuce que vous aimeriez partager,
écrivez-nous à : evezina@cerclei5.org
Journalisation automatique d'un fichier
À partir de la version "V5R3M0", il est maintenant possible de démarrer la journalisation automatiquement lors d’une création de fichier via un SQL (Create table) ou par un CRTPF.
Il suffit qu’un "DTAARA" portant le nom "QDFTJRN" existe dans la bibliothèque où nous créons la table. Ainsi, le fichier créé sera automatiquement journalisé dans le journal indiqué dans le DTAARA.
Il est important de noter que la version V5R4 contient plus de paramètres et plus d'options possibles.
Bref résumé de la documentation IBM:
- En V5R4
- Les 10 premiers caractères doivent contenir le nom de la bibliothèque du journal
- Les 10 seconds caractères doivent contenir le nom du journal
- À partir de la position 21, on doit choisir quel type d'objet on souhaite journaliser automatiquement (*FILE, *DTAARA, *DTAQ, *ALL ou *NONE)
- À partir de la position 31, on doit choisir sur quelle action on doit lancer la journalisation (*CREATE, *MOVE, *RESTORE, *ALLOPR, *RSTOVRJRN)
- Note: Les deux derniers points peuvent être répétés au besoin
- En V5R3
- Les 10 premiers caractères doivent contenir le nom de la bibliothèque du journal
- Les 10 seconds caractères doivent contenir le nom du journal
- À partir de la position 21, on doit obligatoirement écrire: *FILE
- À partir de la position 31, on écrit *NONE pour ne pas journaliser automatiquement et on laisse à blanc si on désire journaliser automatiquement
Pour plus de détails, se référer à la documentation IBM aux liens suivants:
La documentation IBM pour V5R4 ici
La documentation IBM pour V5R3 ici
Haut
Envoie de courriels à partir de votre iSeries
À partir de la version V5R1, il est possible d’envoyer des courriels à partir d’un iSeries – i5. Les courriels envoyés peuvent contenir un message et même une pièce jointe (par exemple un fichier spoule).
En effet, grâce à l’introduction du langage Java sur les iSeries, les nouvelles possibilités sont nombreuses.
L'outil OSJMail, développé à partir de JavaMail, permet l'envoi de courriel à partir d'un système iSeries connecté à internet. Ce logiciel permet l'envoi de messages et de fichiers joints (un fichier IFS ou un fichier spoule).
Pour plus d'information sur le produit OSJMail, accédez à la page de téléchargements de Berco Solutions.
Haut
Comment appeler des SQL (Select) dans un CLP
Si nous voulons exécuter un rapport simple dans un CLP, nous pouvons exécuter des commandes SQL via QSH (Shell Interpreter).
Si nous avons un fichier employé "Ficempl" et nous voulons avoir la liste des employés par département.
Voici le CLP pour ceci :
PGM
OVRDBF FILE(STDOUT) TOFILE(QTEMP/LISTEMPL)
STRQSH CMD('db2 "SELECT Dept, Nom, Prenom FROM +
FicEmp ORDER BY Dept"')
ENDPGM |
Vous pouvez alors consulter le fichier, l’envoyer sur l’IFS ou l’imprimer.
Note : Remarquez que DB2 sous QSH semble fonctionner même si la licence de STRSQL n’est pas installée.
Haut
Sécurité ou souplesse par les exit programs
Pour plus de souplesse, l’i5/OS nous permet d’insérer l’appel d’exit programs à des dizaines d’endroit. Ainsi, nous pouvons, intercepter le mot de passe lors du changement par l’usager, intercepter la connections FTP, intercepter l’exécution d’une commande "REXEC" ou d’une commande à distance ("remote command"), et plus…
Voici la liste en V5R4 du WRKREGINF.
Exit
Exit Point
Point Format Registered Text
================= ========= ======= =============================
QIBM_A1A_RETR_INF RTVI0100 *YES BRM Services/400 object retri
QIBM_A1A_TAPE_INF MEDI0100 *YES BRM Services/400 media inform
QIBM_A1A_TAPE_MOVE MEDM0100 *YES BRM Services/400 media moveme
QIBM_QCA_CHG_COMMAND CHGC0100 *YES Change command exit programs
QIBM_QCA_RTV_COMMAND RTVC0100 *YES Retrieve command exit program
QIBM_QCST_ADMDMN ADMN0100 *YES Cluster administrative domain
QIBM_QDB_CLOSE DBCL0100 *YES Fermer programme d'exit de fi
QIBM_QDB_OPEN DBOP0100 *YES Programme d'exit de fichier b
QIBM_QDC_VRYEXIT PROF0100 *YES Mise hors fonction de la conf
QIBM_QDC_VRYEXIT PRON0100 *YES Mise en fonction de la config
QIBM_QDC_VRYEXIT PSOF0200 *YES Mise hors fonction de la conf
QIBM_QDC_VRYEXIT PSON0200 *YES Mise en fonction de la config
QIBM_QHQ_DTAQ DTAQ0100 *YES Original Data Queue Server
QIBM_QIMG_TRANSFORMS XFRM0100 *YES Point d'exit de conversion d'
QIBM_QJO_DLT_JRNRCV DRCV0100 *YES Delete Journal Receiver
QIBM_QLZP_LICENSE LICM0100 *YES Original License Mgmt Server
QIBM_QMF_MESSAGE MESS0100 *YES Original Message Server
QIBM_QMH_REPLY_INQ RPYI0100 *YES Indicateur de réponse aux mes
QIBM_QNM_EVENT_DTAQ ALRT0100 *YES Network Event Notification
QIBM_QNPS_ENTRY ENTR0100 *YES Network Print Server - entry
QIBM_QNPS_SPLF SPLF0100 *YES Network Print Server - spool
QIBM_QOE_OV_USR_ADM UADM0100 *YES OfficeVision/400 Administrati
QIBM_QOE_OV_USR_SND DOCI0900 *YES OfficeVision/400 Mail Send Ex
QIBM_QOK_NOTIFY VRFY0100 *YES System Directory Notify Exit
QIBM_QOK_SUPPLIER SUPL0100 *YES System Directory Supplier Exi
QIBM_QOK_VERIFY VRFY0100 *YES System Directory Verify Exit
QIBM_QPA_DEVSEL PADS0100 *YES Sélection d'unité virtuelle
QIBM_QPMW_ARM4_ADAP ADAP0100 *YES Programme d'exit d'adaptateur
QIBM_QPQ_TRANSFORM XPDF0100 *YES Point d'exit de conversion IP
QIBM_QPWFS_FILE_SERV PWFS0100 *YES Serveur de fichiers
QIBM_QP0L_SCAN_CLOSE SCCL0100 *YES Scannage système fichiers int
QIBM_QP0L_SCAN_OPEN SCOP0100 *YES Scannage système fichiers int
QIBM_QQQ_QUERY_GOVR QRYG0100 *YES QUERY GOVERNOR
QIBM_QRQ_SQL RSQL0100 *YES Original Remote SQL Server
QIBM_QSQ_CLI_CONNECT CLIC0100 *YES
QIBM_QSU_LCMD EXTP0100 *YES EXIT POINT FOR SEU USER DEFIN
QIBM_QSY_CERT_APPS CERT0100 *YES Applications utilisant des ce
QIBM_QSY_CHG_PROFILE CHGP0100 *YES Change User Profile - after c
QIBM_QSY_CHG_PROFILE CHGP0200 *YES Modifier un profil utilisateu
QIBM_QSY_CHK_PASSWRD CHKP0100 *YES Vérification de mot de passe
QIBM_QSY_CRT_PROFILE CRTP0100 *YES Create User Profile
QIBM_QSY_DLT_PROFILE DLTP0100 *YES Delete User Profile - after d
QIBM_QSY_DLT_PROFILE DLTP0200 *YES Delete User Profile - before
QIBM_QSY_HOSTFUNC FCNR0100 *YES Host Functions
QIBM_QSY_OPNAVCENTRL FCNR0200 *YES Fonctions centralisées du nav
QIBM_QSY_OPNAVCLIENT FCNR0100 *YES Local Navigator Functions
QIBM_QSY_OTHERCENTRL FCNR0200 *YES Fonctions centralisées d'autr
QIBM_QSY_OTHERCLIENT FCNR0100 *YES Local Other Client Functions
QIBM_QSY_RST_PROFILE RSTP0100 *YES Restore User Profile
QIBM_QSY_VLD_PASSWRD VLDP0100 *YES Validation de mot de passe
QIBM_QTA_STOR_EX400 EX400200 *YES
QIBM_QTA_STOR_EX400 EX400300 *YES
QIBM_QTA_TAPE_TMS TMS00200 *YES
QIBM_QTF_TRANSFER TRAN0100 *YES Original File Transfer Functi
QIBM_QTG_DEVINIT INIT0100 *YES Telnet Device Initialization
QIBM_QTG_DEVTERM TERM0100 *YES Telnet Device Termination
QIBM_QTMF_CLIENT_REQ VLRQ0100 *YES FTP Client Request Validation
QIBM_QTMF_SERVER_REQ VLRQ0100 *YES FTP Server Request Validation
QIBM_QTMF_SVR_LOGON TCPL0100 *YES FTP Server Logon
QIBM_QTMF_SVR_LOGON TCPL0200 *YES FTP Server Logon
QIBM_QTMF_SVR_LOGON TCPL0300 *YES FTP Server Logon
QIBM_QTMX_SERVER_REQ VLRQ0100 *YES REXEC Server Request Validati
QIBM_QTMX_SVR_LOGON TCPL0100 *YES REXEC Server Logon
QIBM_QTMX_SVR_LOGON TCPL0300 *YES REXEC Server Logon
QIBM_QTMX_SVR_SELECT RXCS0100 *YES REXEC Server Command Processi
QIBM_QTOD_DHCP_ABND DHCA0100 *YES DHCP Address Binding Notify
QIBM_QTOD_DHCP_ARLS DHCR0100 *YES DHCP Address Release Notify
QIBM_QTOD_DHCP_REQ DHCV0100 *YES DHCP Request Packet Validatio
QIBM_QTOD_SERVER_REQ VLRQ0100 *YES TFTP Server Request Validatio
QIBM_QVP_PRINTERS PRNT0100 *YES Original Virtual Print Server
QIBM_QWC_JOBITPPGM JITP0100 *YES Point d'exit programme d'inte
QIBM_QWC_PRERESTRICT PRER0100 *YES Point de sortie de gestion de
QIBM_QWC_PWRDWNSYS PWRD0100 *YES Prepower down system exit poi
QIBM_QWC_PWRDWNSYS PWRD0200 *YES Prepower down system exit poi
QIBM_QWC_QSTGLOWACN STGL0100 *YES Auxiliary storage lower limit
QIBM_QWT_JOBNOTIFY NTFY0100 *YES Job Notification
QIBM_QWT_PREATTNPGMS ATTN0100 *YES Preattention program exit poi
QIBM_QWT_SYSREQPGMS SREQ0100 *YES Presystem request pgm exit po
QIBM_QYIV_INVGTRSRV GTRS0100 *YES Inventory gathering services
QIBM_QYIV_INVPRCSRV PRCS0100 *YES Inventory processing services
QIBM_QYME_MONITOR MONT0100 *YES Management Central threshold
QIBM_QZCA_ADDC ZCAA0100 *YES Add Client exit point
QIBM_QZCA_REFC ZCAF0100 *YES Refresh Client Information ex
QIBM_QZCA_RMVC ZCAR0100 *YES Remove Client exit point
QIBM_QZCA_SNMPTRAP ZCAT0100 *YES SNMP trap routing exit point
QIBM_QZCA_UPDC ZCAU0100 *YES Update Client Information exi
QIBM_QZDA_INIT ZDAI0100 *YES Database Server - entry
QIBM_QZDA_NDB1 ZDAD0100 *YES Database Server - data base a
QIBM_QZDA_NDB1 ZDAD0200 *YES Database Server - data base a
QIBM_QZDA_ROI1 ZDAR0100 *YES Database Server - object info
QIBM_QZDA_ROI1 ZDAR0200 *YES Database Server - object info
QIBM_QZDA_SQL1 ZDAQ0100 *YES Database Server - SQL access
QIBM_QZDA_SQL2 ZDAQ0200 *YES Database Server - SQL access
QIBM_QZHQ_DATA_QUEUE ZHQ00100 *YES Data Queue Server
QIBM_QZMFMSF_ACT MSFF0100 *YES MSF Accounting Exit
QIBM_QZMFMSF_ADR_RSL MSFF0100 *YES MSF Address Resolution
QIBM_QZMFMSF_ATT_CNV MSFF0100 *YES MSF Attachment Conversion
QIBM_QZMFMSF_ATT_MGT MSFF0100 *YES MSF Attachment Management
QIBM_QZMFMSF_ENL_PSS MSFF0100 *YES MSF Envelope Processing
QIBM_QZMFMSF_LCL_DEL MSFF0100 *YES MSF Local Delivery
QIBM_QZMFMSF_LST_EXP MSFF0100 *YES MSF List Expansion
QIBM_QZMFMSF_MSG_FWD MSFF0100 *YES MSF Message Forwarding
QIBM_QZMFMSF_NON_DEL MSFF0100 *YES MSF Non Delivery
QIBM_QZMFMSF_SEC_AUT MSFF0100 *YES MSF Security and Authority
QIBM_QZMFMSF_TRK_CHG MSFF0100 *YES MSF Track Mail Message Change
QIBM_QZMFMSF_VLD_TYP MSFF0100 *YES MSF Validate Type
QIBM_QZRC_RMT CZRC0100 *YES Remote Command/Program Call
QIBM_QZSC_LM ZSCL0100 *YES Central Server - license mgmt
QIBM_QZSC_NLS ZSCN0100 *YES Central Server - conversion m
QIBM_QZSC_SM ZSCS0100 *YES Central Server - client mgmt
QIBM_QZSO_SIGNONSRV ZSOY0100 *YES TCP Signon Server |
Pour voir comment ça fonctionne, regardez l’exemple "PWRDWNSYS" un peu plus bas.
Haut
PWRDWNSYS – Ecran de confirmation et plus
La commande d’IBM "PWRDWNSYS" du i5, permet de fermer notre i5 en arrêtant tous les sous-systèmes. Il est possible d’ajouter un écran de confirmation ou d’ajouter des fonctionnalités avant l’arrêt des sous-systèmes.
Pour ajouter un exit program :
- Faire "WRKREGINF" et trouver le "QIBM_QWC_PWRDWNSY"
- Faire l’option « Add »
- Entrer "EXTPGMPWRC" comme programme et "PWRD0200" comme format
(attention : "PWRD0100", appelle l’exit program, mais termine le PWRDWNSYS, indépendamment des choix ou annulation de l’exit program.)
Maintenant, votre programme "EXTPGMPWRC" sera appelé à chaque fois que la commande "PWRDWNSYS" sera exécutée.

Faire « NON » va annuler la commande "PWRDWNSYS"
Faire « OUI » va fermer les serveurs et faire le "PWRDWNSYS".
Exemple de code :
| PGM PARM(&EXTINF &FMTEXT &ACT &DLY) 04/12/06
/* Declaration */
DCLF FILE(EXTPGMPWRD) RCDFMT(DSP01)
DCL VAR(&TYPE) TYPE(*CHAR) LEN(1)
DCL VAR(&EXTINF) TYPE(*CHAR) LEN(5)
DCL VAR(&FMTEXT) TYPE(*CHAR) LEN(8)
DCL VAR(&ACT) TYPE(*CHAR) LEN(1)
DCL VAR(&DLY) TYPE(*DEC) LEN(4 0)
CHGMSGQ MSGQ(*USRPRF) DLVRY(*NOTIFY)
monmsg cpf0000
/* Savoir si on est en inter ou batch */
RTVJOBA TYPE(&TYPE)
/* Si on est en batch */
IF COND(&TYPE = '0') THEN(DO)
/* Faire le traitement désiré en batch */
CALL XXXXXX
/* Aller a la fin pour continuer le pwrdwnsys */
GOTO CMDLBL(FINPGM)
ENDDO
/* Si on est en inter */
IF COND(&TYPE = '1') THEN(DO) 0
/* Initialise variable de retour */
CHGVAR VAR(&CHOIX) VALUE(1)
/* On affiche le message de confirmation */
SNDRCVF RCDFMT(DSP01)
RMVMSG MSGQ(*PGMQ) CLEAR(*ALL)
/* Sortir si l'utilisateur a annulé */
IF COND(&CHOIX = 1) THEN(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('La +
commande PWRDWNSYS a été annulée')
ENDRQS
GOTO CMDLBL(FINPGM)
ENDDO
/* Faire le traitement désiré en inter */
CALL XXXXXX
/* Fin if inter*/
ENDDO
FINPGM: RETURN ENDPGM |
Haut