User receives an error when FEX uses -READ within -REMOTE BEGIN/-REMOTE END: FOC339


Diagnostics

Product: Reporting Server
Release: 8207
Primary OS: Linux
Solution Date:

Symptom

(FOC339) FAILURE ON -READ OR -WRITE: CHECK FILEDEF OR ALLOCATION FOR: CARHLD_RMT

Problem

The user receives the error message above when submitting a procedure that uses -READ within -REMOTE BEGIN/-REMOTE END statements. For example:

REMOTE DEST=xxx
-REMOTE BEGIN
TABLE FILE CAR
PRINT CAR BY COUNTRY
ON TABLE HOLD AS CARHLD_RMT
END
-RUN
-READ CARHLD_RMT &COUNTRY.A10.

Solution

This issue occurs because the -READ has an amper variable that is evaluated by the Dialogue Manager prior to submitting the code to the remote server. This results in the error because the amper variable referenced is not resolved before execution.

To address this, use PCHOLD to create the HOLD file on the local server and perform the -READ outside of the -REMOTE BEGIN/-REMOTE END block:

REMOTE DEST=xxx
-REMOTE BEGIN
TABLE FILE CAR
PRINT CAR BY COUNTRY
ON TABLE PCHOLD AS CARLNX
END
-REMOTE END
-RUN
-READ CARLNX  &COUNTRY.A10.