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     Writing Reports using COBOL flat file with OCCURS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Writing Reports using COBOL flat file with OCCURS
 Login/Join
 
Silver Member
posted
I have a COBOL generated text file that I need to use to generate a report from.
It has OCCURS fields in them like in the below example...

JOHN DOE NISSAN DODGE FORD GM HONDA 1234 WOODWARD AVE MI
JANE DOE HONDA HONDA HONDA HONDA HONDA 1234 STONEHEDGE ST MI
JAMES SMITH BMW BMW BMW LEXUS BMW 1234 BEDROCK CT MI
STACEY JOHNSON DODGE DODGE FORD GM DODGE 1234 HIGHLAND BLVD MI
|--------||--------||--------||--------||--------||--------||--------||------------------|||
|--------------------- A R R A Y --------------------------|
OCCURS 6 TIMES

Master File:
------------
FILE=dumpv330, SUFFIX=FIX
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=FIRST_NAME, ALIAS=FIRST_NAME, USAGE=A10, ACTUAL=A10, $
FIELD=LAST_NAME, ALIAS=LAST_NAME, USAGE=A10, ACTUAL=A10, $
SEGNAME=ARRAY1, PARENT=ROOT_SEG, OCCURS=6, SEGTYPE=S0, $
FIELD=CARS_OWNED, ALIAS=CARS_OWNED, USAGE=A5, ACTUAL=A5, $
SEGNAME=THE_REST, PARENT=ROOT_SEG, SEGTYPE=S0, $
FIELD=ADDRESS, ALIAS=ADDRESS, USAGE=A20, ACTUAL=A20, $
FIELD=STATE, ALIAS=STATE, USAGE=A2, ACTUAL=A2, $

Report:
-------
TABLE FILE
PRINT FIRST_NAME
LAST_NAME
CARS_OWNED
ADDRESS
STATE
END
-RUN

Result:
-------
FIRST_NAME LAST_NAME CARS_OWNED ADDRESS STATE
-----------------------------------------------------------------------------
JOHN DOE NISSAN 1234 WOODWARD AVE MI
JANE DOE HONDA 1234 STONEHEDGE ST MI
JAMES SMITH BMW 1234 BEDROCK CT MI
STACEY JOHNSON DODGE 1234 HIGHLAND BLVD MI

Question:
---------
How do I display all the records in the CARS_OWNED array?
Is there something wrong in my masterfile description?

This is just an example.
My actual production application is a much bigger scale.


Thanks,
Ronnel C
WebFocus 7.1.5
IBM ZOS 1.6
 
Posts: 44 | Location: Fort Wayne, IN | Registered: February 07, 2007Report This Post
Master
posted Hide Post
I think your MDF is not defined properly. Try This!
  
FILE=dumpv330, SUFFIX=FIX
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=FIRST_NAME, ALIAS=FIRST_NAME, USAGE=A10, ACTUAL=A10, $
FIELD=LAST_NAME, ALIAS=LAST_NAME, USAGE=A10, ACTUAL=A10, $
FIRLD=CARS,ALIAS=,USAGE=A30,ACTUAL=A30,$
FIELD=ADDRESS, ALIAS=ADDRESS, USAGE=A20, ACTUAL=A20, $
FIELD=STATE, ALIAS=STATE, USAGE=A2, ACTUAL=A2, $
SEGNAME=ARRAY1, PARENT=ROOT_SEG, OCCURS=6, SEGTYPE=S0,POSITION=CARS, $
FIELD=CARS_OWNED, ALIAS=CARS_OWNED, USAGE=A5, ACTUAL=A5, $

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




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Here is an example of a flat file with two sets of occurances to give you a thought to work from.

FILENAME=WORKLOAD,SUFFIX=FIX,
SEGNAME=WORKLOAD,SEGTYPE=S0,
FIELDNAME=INSTR_ID , ALIAS=INSTRID , FORMAT=A9, $
FIELDNAME=INSTR_NAME , ALIAS=NAME , FORMAT=A30,$
FIELDNAME=ACOLL_ID , ALIAS=AY015 , FORMAT=A3, $
FIELDNAME=ADEPT_ID , ALIAS=AY016 , FORMAT=A4, $
FIELDNAME=RCOLL_ID , ALIAS=RC024 , FORMAT=A3, $
FIELDNAME=RDEPT_ID , ALIAS=RC028 , FORMAT=A4, $
FIELDNAME=FAC_RANK , ALIAS=AY017 , FORMAT=A6, $
FIELDNAME=AAUP_IND , ALIAS=AY203 , FORMAT=A1, $
FIELDNAME=TERM_CYT , ALIAS=AY300 , FORMAT=A5, $
FIELDNAME=DAY085_FTE , ALIAS=DAY085 , FORMAT=F3, $
FIELDNAME=DAY320_FTE , ALIAS=DAY320 , FORMAT=F3, $
FIELDNAME=UNO_WRKLD1 , ALIAS=DRC18A , FORMAT=F3, $
FIELDNAME=UNO_WRKLD2 , ALIAS=DRC18B , FORMAT=F3, $
FIELDNAME=UNO_WRKLD3 , ALIAS=DRC18C , FORMAT=F3, $
FIELDNAME=DEPT_TBL , ALIAS=DEPT_TABLE , FORMAT=A100,$
FIELDNAME=CRSE_TBL , ALIAS=COURSE_TABLE , FORMAT=A400,$
SEGNAME=CRSEX, SEGTYPE=S0,PARENT=WORKLOAD,POSITION=CRSE_TBL, OCCURS=25 ,$
FIELDNAME=CRSE_ID , ALIAS = CRSE_ID , FORMAT=A11,$
FIELDNAME=RC18A , ALIAS = RC18A , USAGE=P6.2 , ACTUAL=Z4.2,$
FIELDNAME=RC18D , ALIAS = RC18D , FORMAT=A1,$
SEGNAME=DEPTX, SEGTYPE=S0,PARENT=WORKLOAD,POSITION=DEPT_TBL, OCCURS=10 ,$
FIELDNAME=AY305 , ALIAS = AY305 , FORMAT=I2,$
FIELDNAME=AY315 , ALIAS = AY315 , FORMAT=A4,$
FIELDNAME=AY350 , ALIAS = AY350 ,USAGE = P6.2 , ACTUAL=Z4.2,$


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
It works now!
Thanks for all your help!


Thanks,
Ronnel C
WebFocus 7.1.5
IBM ZOS 1.6
 
Posts: 44 | Location: Fort Wayne, IN | Registered: February 07, 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     Writing Reports using COBOL flat file with OCCURS

Copyright © 1996-2020 Information Builders