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'm brand new to WebFOCUS and am getting a crazy error. Maybe I don't understand the language well enough, but here goes. We're passing 3 variables into a fex and want it to calculate the start date based on the 3 variables (&DT_GRP, &DT_SPAN, &DT_CUR). Basically, the user selects a Date Group (1st variable) of Monthly, Weekly, or Daily. A second variable of Date Span (1-12 if date group is monthly or weekly & 1-31 if date group is daily). A 3rd variable of Date Current (Y or N flag) if they want to see up-to-date data. So, in the following situation, we're trying to calculate the start date if a user has selected up-to-date Monthly data for the last 11 months.
-SET &START_DATE = IF (('&DT_GRP' EQ 'M') AND ('&DT_CUR' EQ 'Y')) THEN AYM(EDIT(&YYMD,'999999'),&DT_SPAN_TEXT,'I6') ELSE 19000101; - ELSE IF (('&DT_GRP' EQ 'D') AND ('&DT_CUR' EQ 'Y')) THEN AYMD(&YYMD,&DT_SPAN_TEXT*(-1),'I8') - ELSE IF (('&DT_GRP' EQ 'W') AND ('&DT_CUR' EQ 'Y')) THEN - IF (DOWK(AYMD(&YYMD,&DT_SPAN_TEXT*(-7),'I8'), 'A3') EQ 'SUN' OR 'SAT') - THEN DATECVT((DATEMOV((DATECVT(AYMD(AYMD(&YYMD,&DT_SPAN_TEXT*(-7),'I8'),-2,'I8YYMD'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE DATECVT((DATEMOV((DATECVT(AYMD(&YYMD,&DT_SPAN_TEXT*(-7),'I8'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE 19000101;
I did that and am still getting an IF...THEN...ELSE error...
I've narrowed down where my error is coming from the following code statement...
-SET &TEST = AYMD(&YYMD,&DT_SPAN_TEXT*(-7),'I8');
-SET &START_DATE3 = IF ((&DT_GRP.EVAL EQ 'W') AND (&DT_CUR.EVAL EQ 'Y')) THEN - IF (DOWK(&TEST, 'A3') EQ 'SUN' OR 'SAT') - THEN DATECVT((DATEMOV((DATECVT(AYMD(&TEST,-2,'I8YYMD'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE DATECVT((DATEMOV((DATECVT(&TEST,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE 19000101;
-SET &START_DATE3 = IF ((&DT_GRP.EVAL EQ 'W') AND (&DT_CUR.EVAL EQ 'Y')) THEN - IF (DOWK(&TEST, 'A3') EQ 'SUN' OR 'SAT') - THEN DATECVT((DATEMOV((DATECVT(AYMD(&TEST,-2,'I8YYMD'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE DATECVT((DATEMOV((DATECVT(&TEST,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE 19000101;
Chg'd &DT_SPAN_TEXT to &DT_SPAN since I don't see the &DT_SPAN_TEXT set anywhere; tested on 7.6.1, based on the -DEFAULT, got 20070813:
-SET &START_DATE3 = IF ((&DT_GRP.EVAL EQ 'W') AND (&DT_CUR.EVAL EQ 'Y')) THEN - IF (DOWK(&TEST, 'A3') EQ 'SUN' OR 'SAT') - THEN DATECVT((DATEMOV((DATECVT(AYMD(&TEST,-2,'I8YYMD'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE DATECVT((DATEMOV((DATECVT(&TEST,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');
-*Commented this out, end the statement above with a ; -* ELSE 19000101;
-TYPE &START_DATE3This message has been edited. Last edited by: Tom Flynn,
This is why we who've been in the programming game for 30+ years like to indent stuff. It takes more hits of the spacebar but it makes structural errors like yours quite visible:
-SET &START_DATE = - IF (('&DT_GRP' EQ 'M') - AND ('&DT_CUR' EQ 'Y')) - THEN AYM(EDIT &YYMD,'999999'), - &DT_SPAN_TEXT, 'I6') - ELSE 19000101; - ELSE IF (('&DT_GRP' EQ 'D') - AND ('&DT_CUR' EQ 'Y')) - THEN AYMD(&YYMD,&DT_SPAN_TEXT*(-1),'I8') - ELSE IF (('&DT_GRP' EQ 'W') - AND ('&DT_CUR' EQ 'Y')) - THEN IF (DOWK(AYMD(&YYMD,&DT_SPAN_TEXT*(-7), 'I8'), 'A3')EQ 'SUN' OR 'SAT') - THEN DATECVT((DATEMOV((DATECVT(AYMD(AYMD(&YYMD,&DT_SPAN_TEXT(7),'I8'),-2,'I8YYMD'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE DATECVT((DATEMOV((DATECVT(AYMD(&YYMD,&DT_SPAN_TEXT*(-7),'I8'),'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - ELSE 19000101;
[Of course, we're sometimes put off by those text editors and language input dialogues that force a new physical line after 80 or so characters !!]
WIN/2K running WF 7.6.4 Development via DevStudio 7.6.4, MRE, TextEditor. Data is Oracle, MS-SQL.
Posts: 154 | Location: NY | Registered: October 27, 2005