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.
I have a report that produces several outputs but only has one criteria. (Currency code).
I require this report run several times. Once for each currency code in my list.
Previously I have amended the criteria manually each time and submitted the report several times. (Once for each currency.)
More recently I have setup several copies of the main report, each one containing a seperate currency code. This way I am able to submit all of these reports overnight without a problem, but still it isn't ideal - especially if I need to make any changes to the report(s).
So, here is my question:
Is there a way I can set an array for the currency codes and get the report to loop for each currency?
Is this possible within focus?
The closest I have come to this is using a seperate focus report that sets a parameter and then uses INCLUDE to call the main focus report. This works, but it means I have to have 2 seperate reports and it still requires a section for each parameter and call.
easy Lets assume the number of currencies is known and fixed... lets say its 3 -SET &KOUNTER = 0 ; -REPEAT end.loop 3 TIMES -SET &KOUNTER = &KOUNTER + 1 ; -SET &CUR=DECODE &KOUNTER( 1 'EU' 2 'GBP' 3 'USD'); ... insert the body of your fex here, using the parameter &CUR however you need to use it. -RUN -end.loop -eoj.thisfex Jamie, note that the way you have it currently, with double includes, if there are statement labels with goto's in that fex, you'll have branching problems.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Just a few quick questions if I may, just so I fully understand it. (My Focus knowledge is very basic)...
Is &KOUNTER a keyword within Focus or is it just the name given in this instance?
Is there a limit on how many items I can use in a decode? Also, if the decode is longer than one line at which point do I perform a split without causing a problem?
One last question. What does the line -eoj.thisfex do? I replaced thisfex with the name of my focus job (fex!?) and it worked fine. Is EOJ - End Of Job?
Once again, many thanks for your time. You have saved me hours!
Jamie
Z/OS - MF FOCUS 7.1.1
Posts: 13 | Location: UK | Registered: February 15, 2006
just a name given in this instance i use I, J, K for all things integer...being a math head. -eoj.thisfex is just a statement label. eoj is end of job, yep. All my statement labels are lower case, for easy readability. Sure decodes can wrap; just make sure to start each new line with a - (because this decode exists in Dialog Manager you need the dashes) There is a limit to a decode but i can't remember what it is.. 40, 50, some char size? dunno. -SET &CUR = DECODE &KOUNTER ( 1 'GBP' - 2 'EU' 3 'USD' - 4 'INDONESIAN RUPIA' );
You could, if you wanted, not use the -REPEAT syntax and handle all the looping yourself. -SET &KOUNTER = 0 ; -top.loop -SET &KOUNTER = &KOUNTER + 1 ; -IF &KOUNTER GT &SOMEVALUE GOTO eoj.thisfex ; -SET &CUR = DECODE...etc ...fex bits...yes fex is focexec, its the suffix on the actual program file -RUN -IF &KOUNTER LT &SOMEVALUE GOTO top.loop ; or -IF &KOUNTER EQ &SOMEVALUE GOTO eoj.thisfex ;This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
FYI - Here's an example of using an external file to drive a loop. I created the external file from the CAR table just for this example. You could filedef any file that you would want to use.
TABLE FILE CAR SUM SEATS BY COUNTRY ON TABLE SAVE AS H_CAR END -RUN -* -*** -* -SET &CNT = 0; -SET &V_COU = ' '; -SET &V_SEA = ' '; -* -TYPE START LOOP -TYPE ---------------------------------------------------------------- -LOOPER -READ H_CAR &V_COU.A10. &V_SEA.I3. -IF &IORETURN NE 0 GOTO EOF; -* -SET &CNT = &CNT + 1; -TYPE IORETURN=&IORETURN --- CNT=&CNT --- V_COU=&V_COU --- V_SEA=&V_SEA -* -* INCLUDE YOUR FEX HERE WITH A -RUN COMMAND -* -GOTO LOOPER -EOF -TYPE ---------------------------------------------------------------- -TYPE END LOOP --- IORETURN = &IORETURN
Jim
WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005
Then again... if the report is the same for each iteration why not simply sort on the cuurency code as the primary sort field using page breaks and the repaging option which starts the page numbering again.
This way you pass through the data only once and all of your reports get created at the same time. They can then be split apart based on the currency code.
ttfn, kp
Access to most releases from R52x, on multiple platforms.
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003
You don't say what MF you are using but whether you are using Z/OS or Z/VM you could just EX the fex in your bacth job (JCL or REXX/EXEC) for each currency code you want rather than use a loop?
EX CCYREPORT CUR='40' EX CCYREPORT CUR='41' .......
The reason I would keep the main fex seperate and use it in this way is that as sure as eggs are eggs, at least one of your users will require a rerun of one particular currency and if you box it up with a looping process, you then have to problem of singling out one currency code to achieve that (unless you use Jims external file method).
Using it as a single fex with one parameter input allows you greater flexibility (imho).
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
When you say you are running a mainframe session via an XP machine, I take it that you are using something like PC3270 to access it?
If this is the case then how are you using FOCUS?
Are you in the IT team there or are you and End User? If an End User then give your IT people a call and they should assist you. Alternatively update your profile with your company name and I may be able to tell you what you have (from experience).
Altenatively, call 0845 658 8181 (IB Support desk in the UK) and have a chat with the support person (Frank).
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I am using Personal Communication v5.6 to login to TSO and access Focus. (The screen is black and text is green.) I am now sure how I can find anything further. Is there a way I can run a fex to tell me more?
Maybe a VERSION command?
I am in the IT / Management Reporting team.
Thanks, Jamie
Z/OS - MF FOCUS 7.1.1
Posts: 13 | Location: UK | Registered: February 15, 2006
Thanks for the help but I'm still rather confused about the version or Focus I'm using. I think I'll have to liasie with the system support people here. The SYSIN DD * part doesn't ring any bells, and neither does the Bank / Grocery part unfortunately. But if I had to make a choice, I'd go with Bank.(!?)
Thanks, Jamie
Z/OS - MF FOCUS 7.1.1
Posts: 13 | Location: UK | Registered: February 15, 2006