Check empty file content using Progress statement

Posted by Admin on 10-Feb-2008 23:14

Hi all,

I have the following lines of code

os-command value("wget -q -O /tmp/" + vReportID + ".pdf http://" + vReportServer + "/output/" + vReportID + ".pdf").
INPUT STREAM inputfile FROM VALUE("/tmp/" + vReportID + ".pdf") BINARY NO-ECHO.
ASSIGN LENGTH(ra_rawdata) = 8192.
REPEAT:
IMPORT STREAM inputfile unformatted ra_rawdata.
PUT {&WEBSTREAM} CONTROL ra_rawdata.
END.
/* Check if the inputting file has empty content */
IF inputting_filecontent EQ empty THEN

PUT {&WEBSTREAM} CONTROL “NO DATA EXTRACTED”.

END.

Can anyone advise me how I can complete the above logical condition using Progress statement?

Many thanks

All Replies

Posted by jtownsen on 11-Feb-2008 03:39

Assuming you're not on a really old version, you could do something like:

FILE-INFO:FILE-NAME = "/tmp/" + vReportID + ".pdf".

IF FILE-INFO:FILE-SIZE = 0 THEN ...

Posted by Admin on 11-Feb-2008 05:44

Ok, it works properly

Thanks Jamie

This thread is closed