Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Handling LOAD errors

Hello:

I've this LOAD instruction in a script, normally it work fine

   

File:
LOAD *
FROM
File.csv
(
txt, codepage is 1252, embedded labels, delimiter is ',', msq);

... but when the input file is empty I get this error

Error: File extdata.cpp, Line xxxx

The input file is generated by an external app and is not possible to get the header columns without records.

Is there any way to check if the file is empty before the load sentence, or a method/sentence/prefix to avoid this error??

Thank you.

Joaquín

1 Solution

Accepted Solutions
tresesco
MVP
MVP

4 Replies
tresesco
MVP
MVP

Try FileSize().

alexandros17
Partner - Champion III
Partner - Champion III

In the script write

set ErrorMode=0;

hope it helps

its_anandrjs

You can use

NoOfRows() and Errormode function.

JoaquinLazaro
Partner - Specialist II
Partner - Specialist II
Author

The answer that best suits to my problem was suggested by tresesco

myFile='file.csv'

vSize = FileSile(myFile)

if vSize = 0 then

else

endif

Thank you for all suggestions