Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Checking whether data exists or not..?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Checking whether data exists or not..?
 Login/Join
 
<delvegas>
posted
Hi guys,
How can we check whether data data exists in Hold file or not..?

-SET &ECHO = ALL;
TABLE FILE EMPLOYEE
SUM EMP_ID
BY LAST_NAME
WHERE LAST_NAME EQ '&ENTER' ;
ON TABLE HOLD AS FIRST FORMAT ALPHA
END

-- NOT BY PRINTING THE DATA IN "FIRST"

THANKS IN ADVANCE
 
Report This Post
Platinum Member
posted Hide Post
Hi,
put a -RUN after your END statement for the TABLE FILE and check the value in &RECORDS.

If there were no records returned &RECORDS WILL BE 0.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Guru
posted Hide Post
If you ever plan to do a 'WHERE TOTAL' in your code I would use &LINES.

Here is an example of where &RECORDS will not work:
TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY CAR
WHERE TOTAL RETAIL_COST EQ 0
ON TABLE HOLD AS H0 FORMAT ALPHA
END
-RUN
-TYPE LINES: &LINES
-TYPE RECORDS: &RECORDS
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
<delvegas>
posted
Thanks guys,
Solved the problem
Really appreciated.

I have one more problem which is more complex..one

Hi

Unable to figure out the problem:- User enter's 2 Test ID. like &STestRequest(100),&CTestRequest (200) and process the request.

-SET &TestRequest = &STestRequest;
! mkdir /tmp/data
! mkdir /tmp/data/A&TestRequest
APP MAP HOLDIR /tmp/data/A&TestRequest
APP HOLD HOLDIR
FILEDEF B&TestRequest DISK /tmp/data/A&TestRequest/B&TestRequest...foc (
use
/tmp/data/A&TestRequest/B&TestRequest (database location)
END
-RUN
-* ----------------------------------------------first test Request
TABLE FILE B&TestRequest
SUM
COUNTRY
WHERE FK_ID EQ &TestRequest
END
-RUN

-IF &RECORDS EQ 0 THEN GOTO WARN1 ELSE WARN1;
"Message Data Exists- for first"
-WARN1
"Message NO Data Exists- for first"

-* ----------------------Problem for this part of code at setting path while processing 2nd request (&CTestRequest)

-SET &TestRequest = &CTestRequest;
APP HOLD
! mkdir /tmp/data
! mkdir /tmp/data/A&TestRequest
APP MAP HOLDIR /tmp/data/A&TestRequest
APP HOLD HOLDIR
FILEDEF B&TestRequest DISK /tmp/data/A&TestRequest/B&TestRequest...foc (
use
/tmp/data/A&TestRequest/B&TestRequest (database location)
END
-RUN
-*------------------------------------------------Second Test Request
TABLE FILE B&TestRequest
SUM
COUNTRY
WHERE FK_ID EQ &TestRequest
END
-RUN

-IF &RECORDS EQ 0 THEN GOTO WARN2;
"Message Data Exists- for Second"
-WARN2
"Message NO Data Exists- for Second"
-EXIT
-------------------------------------------------

Problem is :- For the first test request code (say 100) code is working fine and displaying the message correctly, but for second Test Request (say 200).. It unable to locate to the file where database exists, and always display the message " NO Data Exists ", even though data exists.

ANY SUGGESTION IS APPRECIATED.

Thanks in Advance
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Checking whether data exists or not..?

Copyright © 1996-2020 Information Builders