How to use ESPFTFILE when it contains blanks?

Document ID : KB000054091
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

A file trigger is storing a random file name in %ESPFTFILE. The problem is the next job, a text monitor, does not like the space in %ESPFTFILE. How can we get around it?

Solution:

Here is a workaround: use another variable to add the single quotes on both sides of %ESPFTFILE. See the example below:

TEXT_MON text1
   AGENT WIN_PROD
   FILENM = 'TEXT'   /* this is a value to avoid the error in generation phase */
   if ESP_APPL_PROC = 1 then -   /* ESP_APPL_PROC = 1 means it's Process phase when the TEXT_MON will be processed */
   FILENM = "'" + %ESPFTFILE + "'"   /* Add single quotes for %ESPFTFILE */
   TEXTFILE %FILENM
   TEXTSTRING GOOD
   SEARCHRANGE LINE FROM(1)
   RUN DAILY
ENDJOB