OPALE - 10.0 - Utilisation - Récupérer en critère d'archivage la date du spool d'origine/en

Différence entre versions

De MappingDoc
(Page créée avec « '''Declaring variables:''' »)
(Page créée avec « DCL VAR(&TIME ) TYPE(*CHAR) LEN(6) »)
Ligne 68 : Ligne 68 :
 
'''Declaring variables:'''  
 
'''Declaring variables:'''  
  
DCL        VAR(&HEURE ) TYPE(*CHAR) LEN(6)
+
DCL        VAR(&TIME ) TYPE(*CHAR) LEN(6)
  
 
DCL        VAR(&HH    ) TYPE(*CHAR) LEN(2)
 
DCL        VAR(&HH    ) TYPE(*CHAR) LEN(2)

Version du 4 juin 2019 à 08:22

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 the 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
  • Modify 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 MAP_SPECIF 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 spool 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)


Partie de programme à ajouter

       IF         COND(%SST(&ZONNAM 1 4) *EQ 'TIME') THEN(DO) 
       RTVDTAARA DTAARA(QTEMP/TIME (1 6)) RTNVAR(&HEURE)
       CHGVAR &HH (%SST(&HEURE 1 2))                          
       CHGVAR &MM (%SST(&HEURE 3 2))                          
       CHGVAR &SS (%SST(&HEURE 5 2))                          
       CHGVAR     VAR(&STRVAL) VALUE(&HH *CAT &SEP *CAT &MM + 
         *CAT &SEP *CAT &SS)                       
       CHGVAR     VAR(%BIN(&STRLEN)) VALUE(8)                 
       GOTO FIN                                               
       ENDDO