OPALE - 10.1

Retrieving a value of a spooled file and using it in a command

De MappingDoc
Cette page est une version traduite de la page OPALE:10.1:Récupérer une valeur d'un spool et l'utiliser dans une commande et la traduction est complétée à 100 %.

Introduction

With version 10.1 of OPALE version of IBM-i, it is now possible to retrieve a value of the spooled file and use it in a command.

When we set an action, it is possible to use parameter values, such as &SPLF which define the spooled file name to process It exists a big amount of variables allowing us to retrieve all spooled file attributes. From Version 10.1 of Mapping IBM-i, It is now possible to retrieve data from the first page of the incoming spooled file using &SPLDATA

Syntax

We set &SPLDATA like a function : &SPLDATA(ROW;COL,LENGTH) With ROW, the row number COL, the col number LENGTH : The length of the value to retrieve

Example : If the invoice number is line 5, col 80 with a length of 6 caractères then &SPLDATA(5 80 6) will be used as Invoice number

Nota : The separation caracters can be blank, coma, colomn or semi colomn caracters

Example 1

Creation of an action with a command line allowing us to name the PDF with the invoice number located Row 5, Colonne 51 with 6 caracters long

MAPSPLPDF SPLF(&SPLF) SPLNUM(&SPLNUM) JOB(&JOB) JOBNUM(&JOBNUM) USER(&USER) MAPNAM(TRTFAC) MAPSEQ(00010) NAME('FAC&SPLDATA(5,51,6).PDF') PATH('/Home/Mapping/')

Example 2

Creation of an action with a command line allowing us to redirect the print out to a queue defined in the spooled file Row 1, Colonne 101 to 110

MAPCPYSPLF SPLF(&SPLF) SPLNUM(&SPLNUM) JOB(&JO) JOBNUM(&JOBNUM) USER(&USER) MAPNAM(FACTURES) MAPSEQ(00010) OUTQ(&SPLDATA(1;101;10))