What you need to do is to test the result of your first TABLE FILE first, then branch to proper step.
But except if your input file (CAR) is empty, since you don't have any WHERE clause in the first TABLE FILE, you will always have &LINES GT 0
Is it possible that you had simplified too much your need in the sample code ?
The problem is that if you try to test &LINES of a PCHOLD FORMAT XML output, you will already have that XML returned. So, none of the labeled steps result will be returned.
See below sample
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE PCHOLD FORMAT XML
END
-RUN
-IF &LINES GT 0 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND
-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND
Your option to be able to branch to step is the below
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
BY MODEL
-*WHERE COUNTRY EQ 'ENGLAND';
WHERE COUNTRY EQ 'W GERMANY';
ON TABLE HOLD
END
-RUN
-IF &LINES GT 4 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND
-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND
Or
TABLE FILE CAR
SUM SALES
BY CAR
BY COUNTRY
-*WHERE COUNTRY EQ 'ENGLAND';
WHERE COUNTRY EQ 'W GERMANY';
ON TABLE HOLD FORMAT XML
END
-RUN
-IF &LINES GT 4 THEN GOTO :LBL1;
-:LBL2
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 5
WHERE READLIMIT EQ 5
ON TABLE PCHOLD FORMAT XML
END
-RUN
-GOTO XEND
-:LBL1
TABLE FILE CAR
PRINT *
WHERE RECORDLIMIT EQ 10
WHERE READLIMIT EQ 10
ON TABLE PCHOLD FORMAT XML
END
-RUN
-XEND
Note that you are missing a semicolon at end of the IF statement and GOTO XEND after LBL2
But I don't understand why you need to test an XML file at first step or generates an XML file that you don't care
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007