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     [SOLVED] Output HEADING using multiple -READs

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Output HEADING using multiple -READs
 Login/Join
 
Platinum Member
posted
I'm creating a report that will run in report caster and email an inline message out based on data from a db2 table.

I need the heading (all that will print on email) to look at a variable to figure out what it should say.

Here is a sample car file of what I need.

I setup &CAR_TYPE in the DEFINE

Problem: When I run this it only using last read to produce report. Run code as is and you will see that all headings say "I am Sedan..." even though this is not true. Uncomment WHERE and run it to see heading change to "I am d Other..).

I need to read it once, produce heading, loop then read next record, produce heading etc. What am I doing wrong? If you view source code, the -READ is working, its just using last read to produce all HEADINGS.


Car code
 -SET &ECHO=ALL;
-*-INCLUDE setpathgm.fex
APP HOLD baseapp
DEFINE FILE CAR
CAR_TYPE/A12=IF BODYTYPE EQ 'SEDAN' THEN 'Y' ELSE 'N';
END

TABLE FILE CAR
PRINT CAR_TYPE   COUNTRY CAR MODEL BODYTYPE  SEATS DEALER_COST RETAIL_COST SALES LENGTH WIDTH HEIGHT WEIGHT WHEELBASE FUEL_CAP BHP RPM MPG ACCEL
BY BODYTYPE NOPRINT
-*WHERE BODYTYPE NE 'SEDAN';
ON TABLE HOLD AS TYPE_CAR FORMAT ALPHA
END
-*-EXIT

-SET &LOOP = 1;

-SET &REXREAD = &RECORDS;
-
-REPEAT TOEND &REXREAD TIMES

-RUN
-READ TYPE_CAR NOCLOSE &CAR_TYPE.A12.;
-RUN

-TYPE &CAR_TYPE

-SET &LOOP = &LOOP + 1;
-TOEND

-*-EXIT

-SET &AGCY_CAPPED_FTM1 = '\ibi\apps\baseapp\' | 'type_car.ftm';

FILEDEF type_car DISK &AGCY_CAPPED_FTM1
TABLE FILE TYPE_CAR
PRINT BODYTYPE
		COUNTRY NOPRINT

        MODEL NOPRINT

        SEATS NOPRINT
BY BODYTYPE    NOPRINT
ON BODYTYPE PAGE-BREAK
ON TABLE SET PAGE-NUM OFF
HEADING
-IF &CAR_TYPE EQ 'N' GOTO RUNOTH;
"I AM Sedan <BODYTYPE <COUNTRY <MODEL <SEATS "
""
-GOTO FINISH;
-RUNOTH
"I AM Other <BODYTYPE <COUNTRY <MODEL <SEATS"
-FINISH

ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=SUBHEAD,
     LINE=1,
     FONT='Verdana',
     JUSTIFY=LEFT,
	 SIZE=11,

$
TYPE=SUBHEAD,
     LINE=3,
     FONT='Verdana',
     JUSTIFY=LEFT,
	 SIZE=10,

$
TYPE=SUBHEAD,
     LINE=5,
     FONT='Verdana',
     JUSTIFY=LEFT,
	 COLOR=RED,
	 SIZE=10,

$
TYPE=SUBHEAD,
     LINE=7,
     FONT='Verdana',
     JUSTIFY=CENTER,
	 SIZE=10,
$
TYPE=SUBHEAD,
     LINE=9,
     FONT='Verdana',
     JUSTIFY=CENTER,
	 SIZE=10,

$
TYPE=SUBHEAD,
     LINE=11,
     FONT='Verdana',
     JUSTIFY=LEFT,
	 SIZE=10,

$
TYPE=SUBHEAD,
     LINE=13,
     FONT='Verdana',
     JUSTIFY=LEFT,
	 SIZE=10,
	 COLOR=BLUE,
	 URL=https://pd.txfb-ins.com/webfocus8/approot/sales_mgt/sales_gm_launch.htm,

$
TYPE=DATA,
     WHEN=AGNC_CD LT 0,
	 COLOR=RED,
$
TYPE=TITLE,
     GRID=ON,
$

ENDSTYLE
END


 

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Virtuoso
posted Hide Post
Are you looking for this ?
DEFINE FILE CAR
CAR_TYPE/A1=IF BODYTYPE EQ 'SEDAN' THEN 'Y' ELSE 'N';
END
TABLE FILE CAR
BY BODYTYPE NOPRINT
ON BODYTYPE PAGE-BREAK
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
ON TABLE SET PAGE-NUM OFF

HEADING
"I am Sedan <BODYTYPE"
""
WHEN CAR_TYPE EQ 'Y'

HEADING
"I am Other <BODYTYPE"
WHEN CAR_TYPE EQ 'N'

ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
-RUN


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
I guess that would work but I would have to setup multiple headings which seems like a lot of work....

Here is the actual SUBHEAD I am trying to use.
'Y' LE 0
'N' GT 0

"""
"Here is an update or your allowable growth policies remaining as of ""
"Your Agency has reached its cap."
""
-IF &H_CVT EQ 'Y' GOTO RUNLT40H;
"Homeowners: -GOTO CHKMUT;
-RUNLT40H

"Homeowners: No remaining available policies -CHKMUT
""
-IF &M_CVT EQ 'Y' GOTO RUNLT40M;

"Mutual Policies: ""
-GOTO RUNGT40;
-RUNLT40M
"Mutual Policies: No remaining available policies ""
-RUNGT40;
"If you have any questions, contact your Property Underwriter."
""
"Marketing - Growth Management"


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Platinum Member
posted Hide Post
See if this is better layout.

 "<ASM_NAME"
""
"Here is an update or your allowable growth policies remaining as of <RPT_DT for <AGNC_CD / <CTY_NME_TXT"
""
"Your Agency has reached its cap."
""
-IF &H_CVT EQ 'Y' GOTO RUNLT40H;
"Homeowners: <PCT_HO_POL1 of remaining available policies  <HO_REMN_POL_LMT policies"
-GOTO CHKMUT;
-RUNLT40H
 
"Homeowners: No remaining available policies  <HO_REMN_POL_LMT policies over limit"
-CHKMUT
""
-IF &M_CVT EQ 'Y' GOTO RUNLT40M;

"Mutual Policies: <PCT_MUT_POL1 of remaining available policies  <MUT_REMN_POL_LMT policies"
""
-GOTO RUNGT40;
-RUNLT40M
"Mutual Policies: No remaining available policies  <MUT_REMN_POL_LMT policies over limit"
""
-RUNGT40;
"If you have any questions, contact your Property Underwriter."
""
"Marketing - Growth Management" 


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Virtuoso
posted Hide Post
Why would my option will need more work ?
As far as I can see you will may have few blocks of heading such as below (row combination may be wrong since I don't know how to evaluate the IFs)

HEADING
"<ASM_NAME"
""
"Here is an update or your allowable growth policies remaining as of <RPT_DT for <AGNC_CD / <CTY_NME_TXT"
""
"Your Agency has reached its cap."
""
"Homeowners: No remaining available policies  <HO_REMN_POL_LMT policies over limit"
""
"Mutual Policies: No remaining available policies  <MUT_REMN_POL_LMT policies over limit"
""
"If you have any questions, contact your Property Underwriter."
""
"Marketing - Growth Management" 
WHEN ABC EQ 0

HEADING
"<ASM_NAME"
""
"Here is an update or your allowable growth policies remaining as of <RPT_DT for <AGNC_CD / <CTY_NME_TXT"
""
"Your Agency has reached its cap."
""
"Homeowners: <PCT_HO_POL1 of remaining available policies  <HO_REMN_POL_LMT policies"
""
"Mutual Policies: <PCT_MUT_POL1 of remaining available policies  <MUT_REMN_POL_LMT policies"
""
"If you have any questions, contact your Property Underwriter."
""
"Marketing - Growth Management" 
WHEN ABC NE 0

Why trying to make it complicated when it can be simple ?
Is it really matter if some heading rows are repeated ?
Avoiding the usage of GOTOs make the code easier to read since in case A (WHEN ABC EQ 0) it's the first HEADING block, when it's case B (WHEN ABC NE 0) it's the second HEADING block, …
Is that really matter if you need to create 10 HEADING blocks if it's going to be easier to maintain ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
Ok, so it's not that much more work, I just feel the -READ should do this for me with the GOTO's. I did get it working using your code but I had to use 4 blocks to make sure it checked for all instances. YY NN YN & NY

Thanks
JV


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Virtuoso
posted Hide Post
Edit your first post then add [SOLVED] at the beginning of your subject


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
Well looks like that works when printing a report but it will not work when Report Caster sends out the email. It puts the message for the intended recipient in the body of the message and attaches the others to the message. This will not work, I really need the READ to work unless there is a way to not attach the extra results to the message.

The report caster job bursts on email address
Thanks
JV


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Platinum Member
posted Hide Post
Ok it looks like it was doing that because I was sending all three to one email address. When I sent them to three different addresses as it would in the real world, it seemed to work. Thanks.


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Platinum Member
posted Hide Post
Not sure how to Edit first post, never could figure that out. Sorry.


WebFOCUS 8105m
Windows, All Outputs
 
Posts: 156 | Registered: August 23, 2010Report This Post
Virtuoso
posted Hide Post
Scroll to your first post then at bottom right there will be an icon that looks like an open folder with a pen eraser, click on that


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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     [SOLVED] Output HEADING using multiple -READs

Copyright © 1996-2020 Information Builders