Focal Point
[SOLVED] Nodata..

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

September 22, 2009, 02:26 PM
swati
[SOLVED] Nodata..
Hi all,
i want to know how to use the NODATA .i.e;if my report has '0' records i want to display in the output as NODATA available.so want to know how to start of with....

This message has been edited. Last edited by: Kerry,


7.6.7
windows
PDF,EXCEL.
September 22, 2009, 02:37 PM
swati
i tried:--->
-IF &RECORDS EQ 0 THEN GOTO ENDFEX;

-ENDFEX
-EXIT


WHEN I RUN my code and if the records are equal to 0 i get EDA NO DATA.i want the text as nodata available ,so where can i modify the text...
PLEASE add incase i missed any..........

This message has been edited. Last edited by: swati,


7.6.7
windows
PDF,EXCEL.
September 22, 2009, 02:45 PM
swati
please close it,the problem is solved....


7.6.7
windows
PDF,EXCEL.
September 22, 2009, 06:26 PM
Waz
FYI

NODATA is used for data that is missing/null


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 22, 2009, 07:03 PM
shakila25
Hi Swati,

Sample CAR File:

TABLE FILE CAR
PRINT
COMPUTE SPC/A1=''; AS ''
WHERE RECORDLIMIT EQ 1
BY CAR NOPRINT
ON CAR SUBHEAD
" "
" "
"No Data is available"
" "
END
-RUN


WebFOCUS 7.6.x
Windows
Output: Excel,PDF, HTML
September 23, 2009, 02:08 AM
Gobinath Velusamy
quote:
ORDLIMIT

Hi

After you write the data into SQLOUT

just checn &LNS = 0
then write HTML tag
" No data found for this selecton"

This method is working fine for me

Thanks
Gobinath Velusamy


WebFOCUS 7610
Windows
September 23, 2009, 06:15 AM
Baillecl
As said before : Nodata -> Missing / Null
After the End of the Request ( -RUN to synchronise Focus and DM -DM of the Machine that fills the Data-) the System Variables &LINES etc .. are available.
And the SET EMPTYREPORT = ON / OFF used to do the Job under Focus
Cordially and Focusely
PS : Precise answers or a friendly push towards really getting into the '$Focus$' world ?


Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
September 23, 2009, 08:14 AM
swati
Hi guys,
i am not looking for NODATA OPTION.i am looking for is ---->
if i have '0' records in the output then i want to print saying that "there is no data".if there are any records i will get a report but if there are no records,i want to display a good msg saying "there is no Data".so need a start off for this.......

btw GOBINATH,can you please pass me the code for the HTML tag,which you have written.


7.6.7
windows
PDF,EXCEL.
September 23, 2009, 09:01 AM
Tom Flynn
Swati,

Do you see the </> on the toolbar when you Reply? Put your code between those, and VOILA!, the code is displayed...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 23, 2009, 10:36 AM
<JG>
To cortrect the exaple from shakila25 which would return the SUBHEAD
when data was retrieved

 
TABLE FILE CAR
PRINT
     CAR
WHERE COUNTRY EQ 'USA'
END
-RUN 
-IF &LINES EQ 0 GOTO NODATA;
-EXIT
-NODATA
-HTMLFORM BEGIN
No Data is available
-HTMLFORM END


You can any styling you want into the HTML

But do get some basic training.
September 23, 2009, 10:42 AM
j.gross
The usual method is to extract and hold the data rows for the report, then use dialog manager -IF (or -SET) to sense whether &RECORDS (or &LINES) > 0, and branch (or adjust the report request) accordingly.

I thought about it, and came up with a "pure Focus" alternative, avoiding the Dialog-Manager part:

Convert the TABLE FILE ... HOLD data-extraction section to a MATCH FILE. In the data extraction leg of the Match include a leading column with a row count (equivalent to &LINES); that involves multiple verbs, which is allowed in MATCH FILE. Use the other leg to assure that the merged HOLD file will have at least one row; that enables you to run a TABLE FILE request against the HOLD file, even if the data extraction leg came up empty-handed. Use DEFINE FILE HOLD before the formatted report, to provide a "no data" message in the heading, based on whether COUNT is zero. To avoid displaying zero for numeric columns when the report is "empty", you can redefine them as well, using "S" to suppress display when zero, or making them MISSING when the COUNT column is zero.

As an illustration, run this fex with &LETTER=A (which produces a normal report) and &LETTER=Z (which generates an "empty" report).
-DEFAULT &LETTER='Z'
MATCH FILE CAR
 COUNT ENTRIES
 WRITE SEATS
  BY COUNTRY BY CAR BY MODEL
 IF MODEL CONTAINS '&LETTER'
RUN
FILE CAR
 WRITE FST.COUNTRY AS IGNORE
 AFTER MATCH HOLD OLD-OR-NEW
END

DEFINE FILE HOLD
 NOTE/A30=DECODE COUNT(0 '(No matching records found)' ELSE '');
 SEATS/I5S=SEATS;
END
TABLE FILE HOLD
HEADING CENTER
"<NOTE</1"
 PRINT SEATS
  BY COUNTRY 
  BY CAR SKIP-LINE
  BY MODEL
 ON TABLE PCHOLD FORMAT PDF
END

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
September 23, 2009, 11:00 AM
swati
thanks all........


7.6.7
windows
PDF,EXCEL.