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     Reading sequential file with occurs

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Reading sequential file with occurs
 Login/Join
 
<Jagan>
posted
Hi,

I have a flat file which has data defined with occurs 20 times.
Here is an example of how my data looks on file. (Each line represents a single record,I have given 2 records here).

A1,M1Name,M1Age,M2Name,M2Age,M3Name,M3Age......M20Name,M20Age.
A2,M1Name,M1Age,M2Name,M2Age,M3Name,M3Age......M20Name,M20Age.

I have to sum each and every member whose age is more than 30years in every house.


MY REPORT OUTPUT SHOULD BE LIKE BELOW

HEAD count
A1 6
A2 3
A3 0
A4 1
total: 10
Thanks.
Jagan

how to get this kind of report, basically i have to check for each member age in each house and sum for perticular house.

please let me know some sample code.
thanks a lot in advance.
 
Report This Post
<JG>
posted
Create a multi-segment master using the OCCURS feature.

You learn about it by reading the manual.

Then a simple define accumulating only if over 30 will do all that you want.

P.S. get the company to pay for some basic training.
 
Report This Post
<Jagan>
posted
Hi JG,

If you have any sample code please let me know.

MFD has been already defined for this.

I am learning and completing the programs, because my company is not going to pay for training.
 
Report This Post
Expert
posted Hide Post
Show us the MFD.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<JG>
posted
Jagan,

Please at least search the forum before asking a question

This was posted only 4 days ago

"FILENAME=mymaster, SUFFIX=FIX , $
SEGMENT=SEG1, SEGTYPE=S0, $
FIELDNAME=key, USAGE=A20, ACTUAL=A20, $
SEGMENT=SEG2, SEGTYPE=S0, PARENT=SEG1, OCCURS=10, $
FIELDNAME=FILLER, USAGE=A1, ACTUAL=A1, $
FIELDNAME=PLOTVAL, USAGE=I6, ACTUAL=A6, $"

In your case it will become something like

FILENAME=mymaster, SUFFIX=FIX , $
SEGMENT=SEG1, SEGTYPE=S0, $
FIELDNAME=key, USAGE=A2, ACTUAL=A2, $
SEGMENT=SEG2, SEGTYPE=S0, PARENT=SEG1, OCCURS=20, $
FIELDNAME=NAME, USAGE=A20, ACTUAL=A20, $
FIELDNAME=AGE, USAGE=I6, ACTUAL=A6, $

Adjust the actuals and usage to match your data.

You then have a define

DEFINE FILE mymaster
TOTAL_AGE/I9=IF AGE GE 30 THEN AGE ELSE 0;
END
TABLE FILE mymaster
SUM TOTAL_AGE
BY KEY
END
 
Report This Post
Master
posted Hide Post
quote:
SEGMENT=SEG2, SEGTYPE=S0, PARENT=SEG1, OCCURS=20, $
FIELDNAME=NAME, USAGE=A20, ACTUAL=A20, $
FIELDNAME=AGE, USAGE=I6, ACTUAL=A6, $



You might want to add:
FIELDNAME=F_MEMBER, ALIAS=ORDER, USAGE=I4, ACTUAL = I4,$


This is the same as a defined field, it doesn't really exist in your data. It allows you to select a specific occurance. The ALIAS always has to be ORDER regardless of how many occurs clauses you have in the MFD. You can specify a single occurance:

WHERE F_MEMBER EQ 2

or a range
WHERE F_MEMBER GT 5 AND F_MEMBER LT 10

OR
WHERE F_MEMBER LE 20


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report 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     Reading sequential file with occurs

Copyright © 1996-2020 Information Builders