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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Loop
 Login/Join
 
Gold member
posted
My Sales files end with the YYYYMM suffix pertaining to the month the sales are for. I need to combine files for all months starting from Jan of last year to the current month. I am trying to do it using the folloiwng loop but I get an error ' A VALUE IS MISSING FOR: &CT2'. Tried providing default value for &CT2 but can't get it to move past the -SET &CT2 line. Any suggestions on fixing this? Thanks.



-SET &ECHO=ALL;

-SET &YEARMONTH=EDIT(&YYMD,'999999');
-SET &WHICHYEAR=EDIT(&YYMD,'9999');
-SET &WHICHLASTYEAR=&WHICHYEAR - 1;
-SET &WHICHLASTYEAR01 = &WHICHLASTYEAR || '01';
-SET &MN=AYM(&WHICHLASTYEAR01, +0,I6YYM);
-SET &CT=0;


TABLE FILE SALES&WHICHLASTYEAR01
PRINT *
ON TABLE HOLD AS HOLDMASTER


-REPEAT ENDLOOP WHILE &MN GT &YEARMONTH
-SET &CT2=&CT + 1;
-SET &MN=AYM(&WHICHLASTYEAR01, +&CT2,I6YYM);

MORE
FILE SALES&MN

-ENDLOOP
END
-EXIT

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


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Expert
posted Hide Post
A couple of things. First off, you never increment &CT1. Do that right before the -ENDLOOP line.

Second, I think your WHILE statement is backwards. &MN is less than &YEARMONTH and the WHILE condition as is will jump to -ENDLOOP because the condition is false to start with. Make the condition LT or LE and I think it will work better.

Lastly, for some odd reason, I had to put a semicolon at the end of the -REPEAT line. Otherwise I get a syntax error. Might be my release (7.6.10) because the doc doesn't show a semi nor do I remember ever having to use one before.

Good luck.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
The main obstable was not using a semicolon at the end of the REPEAT statement. It works now with the semicolon there. Thanks for your help.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Expert
posted Hide Post
Just for grins, I checked the doc. The doc is wrong in the appslang manual all the way back to 7.6.0. It is fixed in the 7.6.11 version of the manual. The semicolon is only required for the WHILE option of -REPEAT.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders