//BCHJOB JOB(JPSDSS) JOBD(QBATCH) OUTQ(QPRINT) ENDSEV(60) + LOG(4 00 *SECLVL) MSGQ(*USRPRF) /* Open source scaricabile da www.neroni.it di Claudio Neroni */ /* SE L'USO DELLA JOB DESCRIPTION "QBATCH" TI E' IMPEDITO, */ /* UTILIZZANE UNA DIVERSA. */ /* From System: "IUBICSVI" */ /* From Library: "UTI" */ /* Unload Time: 2008-11-28 17:03 */ /* To File : "JPSDSS" */ /* To Library : "NERONI2" */ /* To Text : "Program status data structure. Src" */ /********* INIZIO ISTRUZIONI *******************************************/ /* LE SUCCESSIVE ISTRUZIONI PERMETTONO DI RICARICARE I SORGENTI. */ /* 1) DA UN VIDEO COMANDI DELL'AS400 RICEVENTE */ /* CREARE UN FILE SORGENTE DI LUNGHEZZA RECORD 112: */ /* CRTSRCPF FILE(NERONI2/STRINGHE) RCDLEN(112) */ /* 2) SPOSTARE IL FILE "JPSDSS.txt" NELL'INDIRIZZARIO */ /* DI UN PC CONNESSO IN RETE CON L'AS400 RICEVENTE */ /* (AD ES.: "c:\"). */ /* 3) DAL VIDEO COMANDI DEL PC CHIAMARE FTP: */ /* ftp nomeas400 */ /* 4) DIGITARE UTENTE E PASSWORD. */ /* 5) ESEGUIRE IL COMANDO DI COPIA DA FILE PC A MEMBRO AS400: */ /* put "c:\JPSDSS.txt" "/qsys.lib/NERONI2.lib/stringhe.file/JPSDSS.mbr"*/ /* 6) ABBANDONARE FTP: */ /* quit */ /* 7) DA UN VIDEO COMANDI DELL'AS400 RICEVENTE */ /* ESEGUIRE LA STRINGA COPIATA NEL MEMBRO SORGENTE: */ /* SBMDBJOB FILE(NERONI2/STRINGHE) MBR(JPSDSS) JOBQ(QBATCH) */ /* LE SUCCESSIVE ISTRUZIONI PERMETTONO DI CREARE L'UTILITY. */ /* 8) DA UN VIDEO COMANDI DELL'AS400 RICEVENTE */ /* ESEGUIRE LA STRINGA O LE STRINGHE SORGENTE DI TIPO SEU "CL" */ /* (IL CUI NOME TERMINA SEMPRE CON ".") */ /* PRESENTI NEL FILE RICARICATO "NERONI2/JPSDSS" */ /* FACENDO ATTENZIONE ALL'ORDINE DI ESECUZIONE INDICATO NEL */ /* MEMBRO FACOLTATIVO "A.LEGGIMI", AD ESEMPIO: */ /* SBMDBJOB FILE(NERONI2/JPSDSS) MBR(JPSDSS.) JOBQ(QBATCH) */ /********* FINE ISTRUZIONI *********************************************/ /* Crea la libreria. */ MKDIR DIR('/qsys.lib/NERONI2.lib') CHGLIB LIB(NERONI2) TEXT('Utility di Claudio Neroni') /* Imposta la lista librerie. */ CHGLIBL LIBL(QTEMP NERONI2 QGPL) /* Crea il file sorgente. */ DLTF FILE(NERONI2/JPSDSS) CRTSRCPF FILE(NERONI2/JPSDSS) RCDLEN(112) + TEXT('Program status data structure. Src') /* Copia il sorgente dalla stringa al membro del file sorgente. */ /* Modifica testo e tipo seu del sorgente caricato. */ CPYF FROMFILE(JPSDS) TOFILE(NERONI2/JPSDSS) + TOMBR(JPSDS) MBROPT(*REPLACE) SRCOPT(*SEQNBR) CHGPFM FILE(NERONI2/JPSDSS) MBR(JPSDS) + SRCTYPE(PF) + TEXT('Program status data structure. PsdsRpg') /* Copia il sorgente dalla stringa al membro del file sorgente. */ /* Modifica testo e tipo seu del sorgente caricato. */ CPYF FROMFILE(JPSDS.) TOFILE(NERONI2/JPSDSS) + TOMBR(JPSDS.) MBROPT(*REPLACE) SRCOPT(*SEQNBR) CHGPFM FILE(NERONI2/JPSDSS) MBR(JPSDS.) + SRCTYPE(CL) + TEXT('Program status data structure. CrtJs') /* Copia il sorgente dalla stringa al membro del file sorgente. */ /* Modifica testo e tipo seu del sorgente caricato. */ CPYF FROMFILE(JPSDSILE) TOFILE(NERONI2/JPSDSS) + TOMBR(JPSDSILE) MBROPT(*REPLACE) SRCOPT(*SEQNBR) CHGPFM FILE(NERONI2/JPSDSS) MBR(JPSDSILE) + SRCTYPE(PF) + TEXT('Program status data structure. PsdsRpgle') /*---------------------------------------------------------------------*/ //DATA FILE(JPSDS) FILETYPE(*SRC) ENDCHAR('//ENDSRC') * Claudio Neroni 01/10/2000 Creato. A R PSDS A TEXT('Program Status + A Data Structure + A for RPG.') A PSDSPN 10 A COLHDG('Program' + A 'name') A PSDS01 26 A COLHDG('...') A PSDSNP 3S A COLHDG('Number of' + A 'received' + A 'parameters') A PSDS02 41 A COLHDG('...') A PSDSLB 10 A COLHDG('Program' + A 'library') A PSDS03 153 A COLHDG('...') A PSDSJB 10 A COLHDG('Job' + A 'name') A PSDSUS 10 A COLHDG('Job' + A 'user') A PSDSJN 6 A COLHDG('Job' + A 'number') A PSDS04 6 A COLHDG('...') A PSDSTT 12 A COLHDG('System' + A 'time' + A 'y?mmd?hhmmss') //ENDSRC /*---------------------------------------------------------------------*/ //DATA FILE(JPSDS.) FILETYPE(*SRC) ENDCHAR('//ENDSRC') //BCHJOB JOB(JPSDS.) JOBD(QBATCH) OUTQ(QPRINTS) ENDSEV(60) LOG(4 + 00 *SECLVL) MSGQ(*USRPRF) /* Claudio Neroni 01/10/2000 Creato. */ /* JPSDS */ /* Program status data structure. */ /* Prerequisiti: nessuno */ /* Imposta la lista librerie. */ CHGLIBL LIBL(QTEMP QGPL) ADDLIBLE LIB(NERONI2) POSITION(*AFTER QTEMP) /* Cancella gli oggetti preesistenti. */ DLTF FILE(NERONI2/JPSDS) DLTF FILE(NERONI2/JPSDSILE) /* Crea gli oggetti. */ CRTPF FILE(NERONI2/JPSDS) SRCFILE(JPSDSS) MBR(*NONE) CRTPF FILE(NERONI2/JPSDSILE) SRCFILE(JPSDSS) MBR(*NONE) //ENDBCHJOB //ENDSRC /*---------------------------------------------------------------------*/ //DATA FILE(JPSDSILE) FILETYPE(*SRC) ENDCHAR('//ENDSRC') * Claudio Neroni 06/06/1998 Creato. * I commenti provengono dal manuale V3R1M0 QBKAQE00 * "ILE RPG/400 Reference" * consultato con: * * STRINFSKR OPTION(*BOOK) BOOK(QBKAQE00) SEARCH('program + * status') * A R PSDSILER A TEXT('Program Status + A Data Structure + A for RPG ILE.') *---------+----------+----------+----------+---------------------+-------- * From | To | | | | * (Position (Position| | | | * 26-32) | 33-39) | Format | Length | Keyword *---------+----------+----------+----------+---------------------+-------- * 1 | 10 | Character| 10 | *PROC * Procedure name. | A PS_PROC 10 A COLHDG('Procedure' + A 'name' ) *---------+----------+----------+----------+---------------------+-------- * 11 | 15 | Zoned | 5,0 | *STATUS | * Status code. | A PS_STATUS 5S 0 A COLHDG('Status' + A 'code' ) *---------+----------+----------+----------+---------------------+-------- * 16 | 20 | Zoned | 5,0 | * Previous status code. | A PS_PRVSTS 5S 0 A COLHDG('Previous' + A 'status' + A 'code' ) *---------+----------+----------+----------+---------------------+-------- * 21 | 28 | Character| 8 | * RPG IV source listing line number. A PS_SRCLST 8 A COLHDG('Rpg IV' + A 'source listing' + A 'line number' ) *---------+----------+----------+----------+---------------------+-------- * 29 | 36 | Character| 8 | *ROUTINE | * Name of the RPG IV routine in which the exception | * or error occurred. This subfield is updated at the | * beginning of an RPG IV routine or after a program | * call only when the *STATUS subfield is updated with | * a nonzero value. The following names identify the | | * routines: | * | | * *INIT Program initialization | | * *DETL Detail lines | | * *GETIN Get input record | | * *TOTC Total calculations | | * *TOTL Total lines | | * *DETC Detail calculations | | * *OFL Overflow lines | | * *TERM Program ending | | * *ROUTINE Name of program or procedure called | | * (first 8 characters). | | * | | * Note: *ROUTINE is not valid unless you use the | | * normal RPG IV cycle. Logic that takes the program | | * out of the normal RPG IV cycle may cause *ROUTINE | | * to reflect an incorrect value. | A PS_ROUTINE 8 A COLHDG('Rpg IV routine' + A 'in which error' + A 'occurred' ) *---------+----------+----------+----------+---------------------+-------- * 37 | 39 | Zoned | 3,0 | *PARMS * Number of parameters passed to this program from a | * calling program. | A PS_PARMS 3S 0 A COLHDG('Parameters' + A 'number' ) *---------+----------+----------+----------+---------------------+-------- * 40 | 42 | Character| 3 | * Exception type (CPF for a OS/400 system exception | * or MCH for a machine exception). | A PS_EXCTYP 3 A COLHDG('Exception' + A 'type' ) *---------+----------+----------+----------+---------------------+-------- * 43 | 46 | Character| 4 | * Exception number. For a CPF exception, this field | * contains a CPF message number. For a machine | * exception, it contains a machine exception number. | A PS_EXCNBR 4 A COLHDG('Exception' + A 'number' ) *---------+----------+----------+----------+---------------------+-------- * 47 | 50 | Character| 4 | * Reserved. | A PS_RESERV 4 A COLHDG('Reserved') *---------+----------+----------+----------+---------------------+-------- * 51 | 80 | Character| 30 | * Work area for messages. This area is only meant | * for internal use by the RPG IV compiler. The | * organization of information will not always be | * consistent. It can be displayed by the user. | A PS_WRKARA 30 A COLHDG('Messages' + A 'work area' ) *---------+----------+----------+----------+---------------------+-------- * Name of library in which the program is located. | * 81 | 90 | Character| 10 | A PS_PGMLIB 10 A COLHDG('Program' + A 'library' ) *---------+----------+----------+----------+---------------------+-------- * 91 | 170 | Character| 80 | * Retrieved exception data. CPF messages are placed | * in this subfield when location *STATUS contains | * 09999. | A PS_EXCDTA 80 A COLHDG('Retrieved' + A 'exception' + A 'data' ) *---------+----------+----------+----------+---------------------+-------- * 171 | 174 | Character| 4 | * Identification of the exception that caused RNX9001 | * exception to be signaled. | A PS_EXCIDE 4 A COLHDG('Exception' + A 'cause of' + A 'RNX9001' ) *---------+----------+----------+----------+---------------------+-------- * 175 | 190 | Character| 16 | * Unused. | A PS_UNUSED1 16 A COLHDG('Unused') *---------+----------+----------+----------+---------------------+-------- * 191 | 198 | Character| 8 | * Date (*DATE format) the job entered system. In the | * case of batch jobs submitted for overnight | * processing, those run after midnight will carry the | * next day's date. | A PS_ENTDAT8 8 A COLHDG('Entrance date' + A 'in *date fmt' ) *---------+----------+----------+----------+---------------------+-------- * 199 | 200 | Zoned | 2,0 | * First 2 digits of a 4-digit year. The same as the | * first 2 digits of *YEAR. | A PS_CENTURY 2S 0 A COLHDG('Entrance' + A 'century' ) *---------+----------+----------+----------+---------------------+-------- * 201 | 208 | Character| 8 | * Name of file on which the last file operation | * occurred (updated only when an error occurs). | A PS_LSTFIL 8 A COLHDG('Last error' + A 'file' ) *---------+----------+----------+----------+---------------------+-------- * 209 | 243 | Character| 35 | * Status information on the last file used. This | * information includes the status code, the RPG IV | * opcode, the RPG IV routine name, the source listing | * line number, and record name. It is updated only | * when an error occurs. | * | * Note: The opcode name is in the same form as | * *OPCODE in the INFDS | A PS_LSTFILS 35 A COLHDG('Last error' + A 'informations' ) *---------+----------+----------+----------+---------------------+-------- * 244 | 253 | Character| 10 | * Job name. | A PS_JOB 10 A COLHDG('Job' + A 'name' ) *---------+----------+----------+----------+---------------------+-------- * 254 | 263 | Character| 10 | * User name from the user profile. | A PS_USER 10 A COLHDG('User') *---------+----------+----------+----------+---------------------+-------- * 264 | 269 | Zoned | 6,0 | * Job number. | A PS_JOBNBR 6S 0 A COLHDG('Job' + A 'number') *---------+----------+----------+----------+---------------------+-------- * 270 | 275 | Zoned | 6,0 | * Date (in UDATE format) the job was entered in the | * system (UDATE is derived from this date). In the | * case of batch jobs submitted for overnight | * processing, those run after midnight will carry the | * next day's date. | A PS_ENTDAT6 6S 0 A COLHDG('Entrance date' + A 'in udate fmt' ) *---------+----------+----------+----------+---------------------+-------- * 276 | 281 | Zoned | 6,0 | * Date of program running (the system date in UDATE | * format). | A PS_RUNDAT6 6S 0 A COLHDG('Run date' + A 'in udate fmt' ) *---------+----------+----------+----------+---------------------+-------- * 282 | 287 | Zoned | 6,0 | * Time of program running in the format hhmmss. | A PS_RUNTIM 6S 0 A COLHDG('Run time' + A 'in hhmmss fmt' ) *---------+----------+----------+----------+---------------------+-------- * 288 | 293 | Character| 6 | * Date (in UDATE format) the program was compiled. | A PS_CPLDAT 6 A COLHDG('Compile date' + A 'in udate fmt' ) *---------+----------+----------+----------+---------------------+-------- * 294 | 299 | Character| 6 | * Time (in the format hhmmss) the program was compiled. A PS_CPLTIM 6 A COLHDG('Compile time' + A 'in hhmmss fmt' ) *---------+----------+----------+----------+---------------------+-------- * 300 | 303 | Character| 4 | * Level of the compiler. | A PS_CPLLVL 4 A COLHDG('Compiler' + A 'level' ) *---------+----------+----------+----------+---------------------+-------- * 304 | 313 | Character| 10 | * Source file name. | A PS_SRCFIL 10 A COLHDG('Source' + A 'file') *---------+----------+----------+----------+---------------------+-------- * 314 | 323 | Character| 10 | * Source library name. | A PS_SRCLIB 10 A COLHDG('Source' + A 'library') *---------+----------+----------+----------+---------------------+-------- * 324 | 333 | Character| 10 | * Source file member name. | A PS_SRCMBR 10 A COLHDG('Source' + A 'member') *---------+----------+----------+----------+---------------------+-------- * 334 | 343 | Character| 10 | * Program containing procedure. | A PS_PROGRAM 10 A COLHDG('Program' + A 'containing' + A 'procedure' ) *---------+----------+----------+----------+---------------------+-------- * 344 | 353 | Character| 10 | * Module containing procedure. | A PS_MODULE 10 A COLHDG('Module' + A 'containing' + A 'procedure' ) *---------+----------+----------+----------+---------------------+-------- * 354 | 429 | Character| 76 | * Unused. | A PS_UNUSED2 76 A COLHDG('Unused') *---------+----------+----------+----------+---------------------+-------- //ENDSRC //ENDBCHJOB