Check empty file content using Progress statement

thanhhm

New Member
Hi all,

I've got 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 help me how i can complete the above logical condition using Progress statement, work-around solution or so

Please help

Many thanks

Thanh
 
Hi all,

I've got 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 help me how i can complete the above logical condition using Progress statement, work-around solution or so

Please help

Many thanks

Thanh

file-info:file-name = inputfile.

if file-info:file-size = 0 then
{&OUT} "NO DATA EXTRACTED" skip.
ELSE DO:
/*Do somthing else....*/
END.
 
Back
Top