Focal Point
[SOLVED] COMPOUND report stopping

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4787078476

February 25, 2015, 03:16 PM
JW777
[SOLVED] COMPOUND report stopping
Please help. The database CRIMDATA has dynamic fields in it. Field 2014_F was dynamically created in the report. I checked the Database. 2011_F, 2012_F and 2013_F fields are there. 2014_F is not there. So instead of running a report (for no data), I want to branch around the next series of reports for CRIMDATA. How do I do that without the COMPOUND report stopping because of this FOC003 error message? It never got to the EMPTYREPORT line because the field could not be found.



-************************************************************************
-DEFAULTS &BEGMON=20140101,&ENDMON=20141231,&YR=2014
-************************************************************************
-*
-SET &YR=EDIT(20140101,'9999');
-SET &FIELDF =2014|_F;
-*
TABLE FILE CRIMDATA
PRINT 2014_F
IF RECORDLIMIT IS 1
ON TABLE SET EMPTYREPORT ANSI
ON TABLE SAVE
END
-RUN
0 ERROR AT OR NEAR LINE 11 IN PROCEDURE crim_section
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: 2014_F
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT
-*-IF &ERROR NE 0 THEN GOTO :NOCRIMDATA;
-EXIT

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
February 25, 2015, 03:49 PM
j.gross
Can you briefly explain to us how and why this data source sometimes does, and sometimes does not, have this field defined at this point in execution?
February 25, 2015, 05:08 PM
FOCdeveloper
Use DM (-SET, -IF) to check the &er values and then branch to next report..


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
February 26, 2015, 02:51 AM
Tony A
Use SYSCOLUM to check for the existence of a field within your file - if you have a synonym then the detail should be in SYSCOLUM.

Consider this code, you can see that the column "SALES" is not included in the extract for MYCAR so the extract from SYSCOLUM for the table MYCAR and column SALES produces no output. Therefore it branches to an error message (could branch anywhere).

If you remove or change the WHERE NAME value to RETAIL_COST then the SYSCOLUM would produce output so you could continue with the rest of the process.

-DEFAULTH &Column = 'SALES'
-*-DEFAULTH &Column = 'RETAIL_COST'
TABLE FILE CAR
  SUM RETAIL_COST
      DEALER_COST
   BY COUNTRY
   BY CAR
   BY MODEL
ON TABLE HOLD AS MYCAR
END
-RUN

TABLE FILE SYSCOLUM
PRINT NAME
WHERE TBNAME EQ 'MYCAR'
WHERE NAME   EQ '&Column'
IF RECORDLIMIT EQ 1
ON TABLE SAVE AS COLTEST
END
-RUN
-IF &LINES EQ 0 THEN GOTO :NOCRIMDATA;

-TYPE Report is OK to run

-EXIT

-:NOCRIMDATA
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<title></title>
</head>
<body>
The field SALES does not exist in the source table definition
</body>
</html>
-HTMLFORM END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 27, 2015, 04:07 PM
JW777
Tony, SYSCOLUM worked! Thank you all for your help!

Jeanette


WebFOCUS 7.6
Windows, All Outputs
March 02, 2015, 05:06 AM
atturhari
Just a FYI - Here's another way


-DEFAULTH &Column = 'SALES'
-*-DEFAULTH &Column = 'RETAIL_COST'
TABLE FILE CAR
SUM RETAIL_COST
DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS MYCAR
END
-RUN

CHECK FILE MYCAR HOLD

TABLE FILE HOLD
PRINT *
END



WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML