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     Variable in Multi Select box.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Variable in Multi Select box.
 Login/Join
 
Platinum Member
posted
Here's what the code should look like:

  
-DEFAULT &AID_YEAR = '0607'
-SET &D_OVERRIDE_YR = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A2')); <==== This Variable

JOIN SPRIDEN_PIDM IN SPRIDEN TO RRRAREQ_PIDM IN RRRAREQ AS J0
JOIN RRRAREQ_PIDM IN SPRIDEN TO SPBPERS_PIDM IN SPBPERS AS J1
TABLE FILE SPRIDEN
PRINT
	 RRRAREQ_TREQ_CODE
     RRRAREQ_TRST_CODE
     RRRAREQ_STAT_DATE/M-D-YY
BY RRRAREQ_STAT_DATE NOPRINT
BY SPRIDEN_ID
BY SPRIDEN_LAST_NAME
BY SPRIDEN_FIRST_NAME
BY SPBPERS_SSN
WHERE SPRIDEN_CHANGE_IND EQ MISSING;
WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.';
WHERE RRRAREQ_TREQ_CODE EQ &TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,&D_OVERRIDE_YR>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;  <=== Should be here
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END


The error I am getting is:
 0 ERROR AT OR NEAR LINE     18  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: &D_OVERRIDE_YR
 0 ERROR AT OR NEAR LINE     18  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: &D_OVERRIDE_YR
 BYPASSING TO END OF COMMAND
 (FOC009) INCOMPLETE REQUEST STATEMENT

 


Is it not possible to put a variable in the multi select box?

Brian


-Brian

Webfocus v7.6.1 on Windows XP
 
Posts: 108 | Registered: June 19, 2006Report This Post
Platinum Member
posted Hide Post
I looked at my profile, and it shows me Webfocus v7.1.1. Also, I use winXP.


-Brian

Webfocus v7.6.1 on Windows XP
 
Posts: 108 | Registered: June 19, 2006Report This Post
Expert
posted Hide Post
Brian,

quote:
-DEFAULT &AID_YEAR = '0607'
-SET &D_OVERRIDE_YR = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A2')); <==== This Variable


Your SUBSTR values are incorrect:

-SET &D_OVERRIDE_YR = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A4'));

I would:

-SET &D_OVERRIDE_YR = SUBSTR(4,&AID_YEAR, 3, 4, 2,'&D_OVERRIDE_YR');
-SET &O_YR = 'DO' || &D_OVERRRIDE_YR ;

Also, &D_OVERRIDE_YR equals 13 bytes, make it 12, max.

Also, your &VARIABLE in the FIND function (<DEPENDENCY_OVERRIDE,&D_OVERRIDE_YR >,
probably will not work as you expect it to...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
apparently not.
i just tried it with a car file example
-SET &MYVAR = 2 ;
-SET &ECHO = ALL ;
TABLE FILE CAR LIST CAR SALES SEATS
WHERE SEATS EQ &SEATS.(OR(<2SEATER, &MYVAR.EVAL >,<3SEATER,3>,<4SEATER,4>)).NUMSEATS.;


and it seems that the underlying javascript is taking that value as a character string
I even stuck an eval on it...no cigar.
See the "" around the entry?
so i would try buiding the entire WHERE statment as a long string from your &vars and then entering it as a &MYWHERE.EVAL

jsData.ampers[i].values[j] = " &MYVAR.EVAL ";
jsData.ampers[i].display[j] = "2SEATER";
j++;

jsData.ampers[i].values[j] = "3";
jsData.ampers[i].display[j] = "3SEATER";
j++;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
ok, this is where I am at.

I got a post from Alan via email. Not sure why it isn't showing up here:
-DEFAULT &AID_YEAR = '0607'
-SET &D_OVERRIDE_YR = SUBSTR(4,&AID_YEAR, 3, 4, 2,'A4');
-SET &O_YR = 'DO' || &D_OVERRIDE_YR;
-SET &O_YR = TRIM('T', &O_YR, 4, '  ', 2, 'A4');
-SET  &SRCH_STRING = '&TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,' | &O_YR | '>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;';


JOIN SPRIDEN_PIDM IN SPRIDEN TO RRRAREQ_PIDM IN RRRAREQ AS J0
JOIN RRRAREQ_PIDM IN SPRIDEN TO SPBPERS_PIDM IN SPBPERS AS J1

TABLE FILE SPRIDEN
PRINT
	 RRRAREQ_TREQ_CODE
     RRRAREQ_TRST_CODE
     RRRAREQ_STAT_DATE/M-D-YY
BY RRRAREQ_STAT_DATE NOPRINT
BY SPRIDEN_ID
BY SPRIDEN_LAST_NAME
BY SPRIDEN_FIRST_NAME
BY SPBPERS_SSN
WHERE SPRIDEN_CHANGE_IND EQ MISSING;
WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.';
WHERE RRRAREQ_TREQ_CODE EQ &SRCH_STRING;
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K


And now, I am getting the following error message:

 0 ERROR AT OR NEAR LINE     23  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: &TREQ_CODE
 BYPASSING TO END OF COMMAND
 (FOC009) INCOMPLETE REQUEST STATEMENT




So Tom, are you saying this isn't possible?

Brian


-Brian

Webfocus v7.6.1 on Windows XP
 
Posts: 108 | Registered: June 19, 2006Report This Post
Expert
posted Hide Post
Brian,

Your search string is incorrect:

quote:
-SET &SRCH_STRING = '&TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,' | &O_YR | '>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;';


S/B:

-SET &SRCH_STRING = '&' || 'TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,' | &O_YR | '>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;';

Anyway, try it, pretty sure it won't work. Unfortunately, at UNCG, JavaScript within HTML is not utilized; Susannah had a great idea, but, not supported.


So, this was my workaround at UNCG:

-SET &ECHO=ALL;
-SET &MONTH = EDIT(&DATEYYMD,'$$$$$99');
-SET &CUR_YR = EDIT(&DATEYYMD,'9999');
-SET &YR1 = IF &MONTH LE '06' THEN &CUR_YR ELSE &CUR_YR + 1;
-SET &YR2 = &YR1 - 1;
-SET &YR3 = &YR1 - 2;
-SET &YR4 = &YR1 - 3;
-SET &YR5 = &YR1 + 1;
APP HOLD FINANCE
-RUN
CREATE FILE FY_YEAR
-RUN
MODIFY FILE FY_YEAR
FREEFORM FY_DATE
MATCH FY_DATE
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA
&YR1.EVAL
&YR2.EVAL
&YR3.EVAL
&YR4.EVAL
&YR5.EVAL
END
-RUN

Then, in your fex:

WHERE FISCAL_YEAR EQ '&FY.(FIND FY_DATE IN FY_YEAR).Fiscal Year.';


Moreland called me back, start Monday, the 5th. See you then. If you like, give me a buzz...

Tom
(804) 244-6195

P.S. Modified to remove Graemlin's.....

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
I deleted the entry 'cos it was wrong!!!! Sorry.

There is a way to achieve this in WebFocus, but it is a little messy. Basically you have to fool the auto-prompt parser.
  
-DEFAULT &AID_YEAR = '0607'
-SET &O_Y = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A2'));
-SET  &SRCH_STRING = 'WHERE RRRAREQ_TREQ_CODE EQ &TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,&O_Y>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;';

-IF &TRST_CODE.EXIST GOTO :NOPROMPT;

TABLE FILE SPRIDEN
PRINT
	 RRRAREQ_TREQ_CODE
WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.'; 
&SRCH_STRING.EVAL
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;
END

-EXIT
-:NOPROMPT
-SET &TREQ_CODE = IF &TREQ_CODE CONTAINS '&O_Y' THEN &TREQ_CODE | ' OR ' | '''' | &O_Y | '''' 
- ELSE &TREQ_CODE;
JOIN SPRIDEN_PIDM IN SPRIDEN TO RRRAREQ_PIDM IN RRRAREQ AS J0
JOIN RRRAREQ_PIDM IN SPRIDEN TO SPBPERS_PIDM IN SPBPERS AS J1

TABLE FILE SPRIDEN
PRINT
	 RRRAREQ_TREQ_CODE
     RRRAREQ_TRST_CODE
     RRRAREQ_STAT_DATE/M-D-YY
BY RRRAREQ_STAT_DATE NOPRINT
BY SPRIDEN_ID
BY SPRIDEN_LAST_NAME
BY SPRIDEN_FIRST_NAME
BY SPBPERS_SSN
WHERE SPRIDEN_CHANGE_IND EQ MISSING;
WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR';
WHERE RRRAREQ_TREQ_CODE EQ &TREQ_CODE;
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE;
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END



I think that's it, if not let me know and I will recheck, I've had this working, but on a much simpler syntax, so please check this syntax.

ONE ERROR FIXED.
TWO ERRORS FIXED
THREE ERRORS FIXED, must take more care!

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Alan,

WF still won't resolve &TREQ_CODE...

Great idea though, will test in 7.6 with CAR...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Tom

I missed a bit of code and fixed an error. Should be okay now.

It is also essential that the &var name is not longer than the field length. When you see an echo you'll see why!


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Platinum Member
posted Hide Post
Alan,

Well, your code worked great! Thanks to all who put in to this....Tom, Susannah.

Now, I've just to go work out what the code is actually doing. But I know the output is fine.


-Brian

Webfocus v7.6.1 on Windows XP
 
Posts: 108 | Registered: June 19, 2006Report This Post
Platinum Member
posted Hide Post
Ok, so I need a little help here in understanding this.

What is this part doing here? I'm not sure i understand how you could put the TABLE before the JOIN. I see the .EVAL but I don't know what that means.
-IF &TRST_CODE.EXIST GOTO :NOPROMPT;

TABLE FILE SPRIDEN
PRINT
	 RRRAREQ_TREQ_CODE
WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.'; 
&SRCH_STRING.EVAL
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;
END

-EXIT
-:NOPROMPT
BLAH BLAH BLAH


Brian


-Brian

Webfocus v7.6.1 on Windows XP
 
Posts: 108 | Registered: June 19, 2006Report This Post
Expert
posted Hide Post
Brian,

quote:
-IF &TRST_CODE.EXIST GOTO :NOPROMPT;


If &TRSR_CODE already exists, skip the prompting. I don't think you need this part...

Brian post what you did...Thanks

Alan, GREAT!! Didn't think we could do this, excellent stuff...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Brian

Okay, we're fooling WebFocus here.

Even the first TABLE is not necessary. The Auto Prompt parser is looking for certain strings, it doesn't actually seem to care where they occur.

So you could have in the first part:
  
-DEFAULT &AID_YEAR = '0607'
-SET &O_Y = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A2'));
-SET  &SRCH_STRING = 'WHERE RRRAREQ_TREQ_CODE EQ &TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,&O_Y>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;';

-IF &TRST_CODE.EXIST GOTO :NOPROMPT;

WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.'; 
&SRCH_STRING
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;

-EXIT
-:NOPROMPT

As I say, the parser is purely searching for known strings with &variables in them.


When I say -IF &TRST_CODE.EXIST GOTO :NOPROMPT; all I am saying is has there been a value set for &TRST_CODE, or basically have we been through auto-prompt yet. If so lets get to the real work, the TABLE request, if not, it should be auto prompt parsing the code, so carry on until the -EXIT. Oh, the .EVAL isn't required on &SRCH_STRING, that was me in a hurry.

Hope that helps. If not I'll try another explanation! It is a bit weird, yes.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
One more slight change, remove an unnecessary step:

-IF &TRST_CODE.EXIST GOTO :NOPROMPT;

WHERE RRRAREQ_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.'; 
WHERE RRRAREQ_TREQ_CODE EQ &TREQ_CODE.(OR(<DEPENDENCY_OVERRIDE,&O_Y>,<PJ_DEPENDENT,SPCOND>,<PJ_INDEPENDENT,SPCONI>)).TREQ_CODE.;
WHERE RRRAREQ_TRST_CODE EQ &TRST_CODE.(OR(<READY FOR REVIEW,N>,<SATISFIED,S>,<INCOMPLETE,I>,<DENIED,X>,<WAIVED,W>)).TRST_CODE.;

-EXIT
-:NOPROMPT
-DEFAULT &AID_YEAR = '0607'
-SET &O_Y = ('DO'||SUBSTR(4,&AID_YEAR, 3, 4, 2, 'A2'));
.
.


Because the variable &O_Y is used, not the value of &O_Y, at the auto-prompt stage.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | 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     Variable in Multi Select box.

Copyright © 1996-2020 Information Builders