RXS_initTplEng()

Call this subprocedure to initialize the Template Engine environment. Its parameters allow programmers to override default options. To accept a default, pass the keyword ‘*omit’ for a particular parameter.

Note: Sending to standard out (using RXS_STDOUT for pOutType) when offering a web service generally executes faster because it does not need to go to an IFS stream file first. Using RXS_VAR for pOutType will also execute slightly faster when executing a web service on a remote machine because it does not need to go to an IFS stream file.

Subprocedure Prototype

D RXS_initTplEng...
D                 pr

Initializes the template engine, and can be used to temporarily override default options.

D  pOutType                           value like(RXS_Type)

Required

Valid Values:

  • RXS_STDOUT
  • RXS_STMF
  • RXS_VAR

Used to specify where to send output when the internal buffer is flushed. Passing RXS_STDOUT will route output to standard output (used when offering a web service from your System i5). Passing RXS_STMF will route output to an IFS stream file. Passing RXS_VAR will allow the content to be buffered until RXS_getBuffData() is called to retrieve the data.

D  pOutFile                           const options(*omit)
D                                     like(RXS_FilePath)

If pOutType = RXS_STMF this parameter specifies the file name of the IFS file that will receive the output. Specify the full path (i.e. /myifs/folder/myfile.xml) only when the desired destination is not in the default transaction directory. If pOutType = RXS_STDOUT, specify *Omit here.

Valid Values:

  • *Omit
  • file name
  • qualified file path

D  pCodePage                    10u 0 const options(*omit)

If pOutType = RXS_STMF, this parameter can contain a code page to override the default. If pOutType = RXS_STMF and this parameter is omitted, RXS will use the job's default values. If pOutType = RXS_STDOUT, specify *Omit here.

Valid Values:

  • *Omit
  • code page id

D  pTplDir                            like(RXS_FilePath)
D                                     const options(*omit)

Specifying the template directory temporarily overrides the location the Template Engine should look for templates.

Example: /home/myname/templates/.

Valid Values:

  • *Omit
  • qualified directory path

D  pTransDir                          like(RXS_FilePath)
D                                     const options(*omit)

Specifying the transaction directory temporarily overrides the location where the Template Engine will place XML transaction files (i.e. XML documents.)

Example: /home/myname/trans/

Valid Values:

  • *Omit
  • qualified directory path

D  pDebug                         n   value

Setting this to *On will enable writing informational messages to the job log for debugging purposes. Once an application goes into production, set this value to *Off to keep job logs from filling up.

Valid Values:

  • *On
  • *Off