Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileList - capture missing file

In my job I have currently a check if input file exists via tFileExists. In the project I will have at the end quite a few jobs which should contain this check however the job gets little bit complicated. Therefore I'll create a master job with prejob, where prejob will contain check for these files.

 

To simply things even more I wanted to use tFileList compoment with the following settings:

  • I know the exact file names which I expect in subjobs therefore filemask contains exact files names (no wildcards)
  • "Generate Error if no file found" is checked. However my understanding based on testing this component is that it will throw an error only if none of the files specified in files does not exists.

 

My sample job looks like this:

0683p000009M6Js.png

 

Section in the blue might not be required since tFileList already verified that file exists (it iterated over it).

 

However I would like to stop execution of the job if the file specified in the files does not exists (red section); there was no iteration over the file. I could put some message to die component so anything what executes job via command line can handle this (if needed).

 

Is in TOS possible to catch file which does not exists, and how? One possible solution comes to mind to put multiple tFileExist components to prejob, but this not exactly what I want. If I will end at the end with 50 different files it will get messy.

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi @pepco ,

 

You can use the global variable tFileList_1_CURRENT_FILEPATH in tFileExist -> Run If ( !((Boolean)(tFileExist_1_EXISTS))) -> Then tDie

 

Thanks and Regards,

Subhadip

Anonymous
Not applicable
Author

This actually doesn't work, because tFileList will not send non-existing file to tFileExist. Check this on pictures:

-

0683p000009M6Wi.png

-

0683p000009M6a5.png

-

 

0683p000009M6aA.png

 

I would actually need to capture that non-existing file name.