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.
Hi, I need to generate a random sample with built-in criteria. For example, I need a random sample of 10 records but I need to make sure that I have at least one person named Joe in that sample. I know how to generate a random sample but can't figure out how to set a condition. Thanks.
Say you want to extract 10% of the records in the file. I would suggest you extract 10% of all "Joe" records and 10% of all the others.
Something like this:
-SET &R=INT(10*RDUNIF('D6.4'));
-SET &CAR=COUPE;
-* Create a CAR file with more than 18 records
TABLE FILE CAR
PRINT COUNTRY CAR BODYTYPE
ON TABLE HOLD AS GEN
-REPEAT #GEN 10 TIMES;
MORE
FILE CAR
-#GEN
END
-RUN
-* Retrieve 10% of records having &CAR and 10% of records not having &CAR
DEFINE FILE GEN
RAND/I1 WITH BODYTYPE = IF BODYTYPE NE '&CAR' THEN INT(10*RDUNIF('D6.4')) ELSE 0;
RBOD/I1 WITH BODYTYPE = IF BODYTYPE NE '&CAR' THEN 0 ELSE INT(10*RDUNIF('D6.4'));
END
TABLE FILE GEN
HEADING
"R=&R "
PRINT COUNTRY CAR BODYTYPE
WHERE (RAND EQ &R) OR (RBOD EQ &R);
END
Does this fit?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006