|
| 1 | +**FREE |
| 2 | +Ctl-Opt NoMain Option(*SrcStmt : *NoDebugIO) Bnddir('SERVICES'); |
| 3 | + |
| 4 | +Dcl-F QSYSPRT PRINTER(132) usropn oflind(overflow); |
| 5 | + |
| 6 | +/include 'PRINT.RPGLEINC' |
| 7 | +/include 'commands.RPGLEINC' |
| 8 | + |
| 9 | +// // ============================================================ |
| 10 | +// // Set up test suite. Executed once per RUCALLTST. |
| 11 | +// // ============================================================ |
| 12 | +Dcl-proc setUpSpool export; |
| 13 | +Dcl-pi *n; |
| 14 | + spoolAInitialiser likeds(Spool); |
| 15 | +end-pi; |
| 16 | + |
| 17 | + Dcl-s rc Char(1); |
| 18 | + |
| 19 | + execCommand('OVRPRTF FILE(QSYSPRT) TOFILE(*FILE) + |
| 20 | + SPLFNAME(' + %trim(spoolAInitialiser.spoolName) + ') OVRSCOPE(*JOB)'); |
| 21 | + monitor; |
| 22 | + OpenSpool(); |
| 23 | + print('Executing: setUpSpool('+ %trim(spoolAInitialiser.spoolName) + ')'); |
| 24 | + on-error; |
| 25 | + // ignore errors ... |
| 26 | + // ... but try to remove the override. |
| 27 | + monitor; |
| 28 | + execCommand('DLTOVR FILE(QSYSPRT) LVL(*JOB)'); |
| 29 | + on-error; |
| 30 | + dsply '*** Failed to delete QSYSPRT override! ***' rc; |
| 31 | + endmon; |
| 32 | + endmon; |
| 33 | + |
| 34 | +End-Proc; |
| 35 | + |
| 36 | +// ============================================================ |
| 37 | +// Ouvre le spool. |
| 38 | +// ============================================================ |
| 39 | + Dcl-Proc OpenSpool export; |
| 40 | + Dcl-PI *N; |
| 41 | + End-PI; |
| 42 | + |
| 43 | + open QSYSPRT; |
| 44 | + |
| 45 | + End-Proc; |
| 46 | + |
| 47 | +// ============================================================ |
| 48 | +// Écrit un message dans le spool. |
| 49 | +// ============================================================ |
| 50 | + Dcl-Proc WRITESPOOL export; |
| 51 | + Dcl-PI *N; |
| 52 | + MESSAGE CHAR(132) CONST; |
| 53 | + End-PI; |
| 54 | + |
| 55 | + Dcl-DS lineOutput LEN(132) INZ; |
| 56 | + END-DS; |
| 57 | + |
| 58 | + |
| 59 | + lineOutput = %trim(MESSAGE); |
| 60 | + |
| 61 | + write QSYSPRT lineOutput; |
| 62 | + |
| 63 | + End-Proc; |
| 64 | + |
| 65 | +// ============================================================ |
| 66 | +// Ferme le spool. |
| 67 | +// ============================================================ |
| 68 | + Dcl-Proc CloseSpool export; |
| 69 | + Dcl-PI *N; |
| 70 | + End-PI; |
| 71 | + |
| 72 | + if (%open(QSYSPRT)); |
| 73 | + close QSYSPRT; |
| 74 | + endif; |
| 75 | + |
| 76 | + End-Proc; |
0 commit comments