OPALE - 10.0 - Usage
Retrieving the date of an original spooled file as archiving criterion
Description
Use this to archive spooled files by retrieving the date on which the spooled file was originally created and use it as an archiving criterion (not only the archiving date).
General Principle
Use a specific replacement zone in your Designer template.
Use the MAPRTVNFO command on the IBM i to retrieve the Date and Time information of a spooled file. Edit the specific replacement CL to retrieve time information in the Mapping zone and change the zone type to Archive.
Procedure
- Add a specific replacement zone into the layout (e.g. called DATE)
- Generate the format and import it onto the IBM i
- Edit the specific replacement CL (see the section below)
- Add the MAPRTVNFO command to the spooled file processing (see the section below)
Tips
Editing the specific replacement CL:
- In a command prompt type STRPDM
- Choose option 3 Manage Members
- Select the QSPECIF file in Opale
- Copy the MAPSPECIF member under another name (e.g. MAPSPEC_S)
- Type 2 (Edit) in front of the MAP_SPECIF member
- Declare the working variables as follows: DCL VAR(&DATE ) TYPE(*CHAR) LEN(10)
- Add the following to the program body (be careful where you are adding it):
IF COND(%SST(&ZONNAM 1 4) *EQ 'DATE') THEN(DO) RTVDTAARA DTAARA(QTEMP/DATE (1 10)) RTNVAR(&DATE) CHGVAR VAR(&STRVAL) VALUE(&DATE) CHGVAR VAR(%BIN(&STRLEN)) VALUE(9) GOTO FIN ENDDO
- Caution: DATE in bold corresponds to the Mapping zone name
- Save, exit and recompile the MAP_SPECIF member
Adding the MAPRTVNFO command to the spooled file processing
To edit a robot action:
- Choose option 14 of the IBM i Mapping menu: Operations Menu
- Choose option 2 Managing actions and command lines / Action
- Type F6 Creating a new action and give it a name (e.g. DATEMAP)
- 5 (Command Lines) in front of the new action
- Type F6 Create then MAPRTVNFO and press F4
- Fill in the parameters as follows:
- Confirm then create a new command line with F6
- Type the command you used to re-map the spooled file: MAPCPYSPLF...
Note:
To retrieve the spooled file time, repeat the same steps with another specific replacement zone (e.g. TIME) and change the MAP_SPECIF CL like so:
Declaring variables:
DCL VAR(&TIME ) TYPE(*CHAR) LEN(6)
DCL VAR(&HH ) TYPE(*CHAR) LEN(2)
DCL VAR(&MM ) TYPE(*CHAR) LEN(2)
DCL VAR(&SS ) TYPE(*CHAR) LEN(2)
DCL VAR(&SEP ) TYPE(*CHAR) LEN(1)
Code bits to be added:
IF COND(%SST(&ZONNAM 1 4) *EQ 'TIME') THEN(DO)
RTVDTAARA DTAARA(QTEMP/TIME (1 6)) RTNVAR(&TIME)
CHGVAR &HH (%SST(&TIME 1 2))
CHGVAR &MM (%SST(&TIME 3 2))
CHGVAR &SS (%SST(&TIME 5 2))
CHGVAR VAR(&STRVAL) VALUE(&HH *CAT &SEP *CAT &MM +
*CAT &SEP *CAT &SS)
CHGVAR VAR(%BIN(&STRLEN)) VALUE(8)
GOTO END
ENDDO