Submitted by Anonymous (not verified) on Mon, 02/05/2007 - 00:00
Forums

I use Query400. The spool files created, contains a first page with information about the query definition. Can Interform400 remove that first page and merge the rest, with an overlay?
 

Full name
Administrator

admin

Mon, 02/05/2007 - 00:00

Yes. From Auto Forms Control(AFC=Sub-system in InterForm400) you can call an exit program. This program is called with the parameters needed for identifying a spool file. Run the command CHGSPLFA with the parameter PAGERANGE(2 *END) in your program, and then merge with an overlay again. It can be done as follows:


As an example a query creates spool files on a AFC monitored output queue with form type: QUERY.

The definitions of AFC could be:

  Update AFC-functions attached to output queues

  Queue: KSE Library: KSE

 Seqnbr Funct Form type Save Jobname Filename Device file
  0001 6 QUERY
  Hold Spooled File
 0002 8 QUERY
  Call, program: EXITPGM library: KSE
 0003 1 PART
 Merge, Overlay: DEMO Fileset: KSE                

And the program could look like this:

   /************************************************************/
  /* EXIT PROGRAM FROM AFC (AUTO FORMS CONTROL IN INTERFORM) */
 /* */
 /* THIS PROGRAM CHANGES THE PAGERANGE AND THE FORM TYPE */
  /* PARAMETERS OF A SPOOLFILE AND RELEASES THE SPOOLFILE. */
 /* */
 /* */
 /* */
 /* */
 /************************************************************/

  PGM PARM(&JOBNAME &USER &JOBNUMBER &FILENAME +
  &FILENUMBER &OUTPUTQ &LIBRARY)
  DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
 DCL VAR(&USER) TYPE(*CHAR) LEN(10)
  DCL VAR(&JOBNUMBER) TYPE(*CHAR) LEN(6)
  DCL VAR(&FILENAME) TYPE(*CHAR) LEN(10)
  DCL VAR(&FILENUMBER) TYPE(*CHAR) LEN(4)
 DCL VAR(&OUTPUTQ) TYPE(*CHAR) LEN(10)
 DCL VAR(&LIBRARY) TYPE(*CHAR) LEN(10)

 CHGSPLFA FILE(&FILENAME) +
  JOB(&JOBNUMBER/&USER/&JOBNAME) +
  SPLNBR(&FILENUMBER) FORMTYPE(PART) +
  PAGERANGE(2 *END)

 RLSSPLF FILE(&FILENAME) +
 JOB(&JOBNUMBER/&USER/&JOBNAME) +
  SPLNBR(&FILENUMBER)
 ENDPGM  

If you are not running a light version of InterForm400, you could actually merge the overlay in the exit program by inserting the APF3812/APF3812 command:

  APF3812/APF3812 KARTSET(&FILE_SET) KLICHE(&OVERLAYNAME) +
 FILNVN(&FILENAME) +
 JOB(&JOBNUMBER/&USER/&JOBNAME) +
  SPLNBR(&FILENUMBER) OUTQ(&LIB/&OUTQ) +
  PRTTYP(HP4) INTERF(ASCII850) DRAWER(5)