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 need to be able to obtain the current/system date as an external variable using the following format. Format MMM-YY (A150V) example: FEB-06
At present, I have virtual fields created via define to capture this however the table has millions of rows and I need to be able to make it an external variable; here's the define statement: DEFINE FILE filename ADD SYSDTTM/HYYMDS=HGETC(8, 'HYYMDS'); SYSMONTH/A25=HNAME(SYSDTTM, 'MONTH', 'A25'); SYSYEAR/A4=HNAME(SYSDTTM, 'YEAR', 'A4'); SYSYR/A2=EDIT(SYSYEAR, '$$99'); SYSMON/A3=EDIT(SYSMONTH, '999$$$$$$'); CSYSDATE/A150=SYSMON || '-' || SYSYR; END
Sara, we don't know what system you're on (you could edit your profile and tell us), but you can do manipulations in dialog manager on the system date, either &DATE or &YYMD. Try them both and see which one you like as a starting point.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Error: 0 ERROR AT OR NEAR LINE 7 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC003) THE FIELDNAME IS NOT RECOGNIZED: FEB BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
However when using similar code: -SET &SHOWDT2=UPCASE(150, &DATEMt, 'A150V'); -SET &SHOWDT=&SHOWDT2 || '-' || &DATEY; -RUN - TYPE START_DATE=&SHOWDT end_date=&SHOWDT2 -RUN -EXIT
In the TABLE request you are basically asking it to print out a field called &SHOWDT2 which is equal to FEB. Do you have a field called FEB?
Be sure to use an ECHO when you are testing with amper variables so that you can see how your code is being resolved. It'll make the errors easier to understand.
ttfn, kp
Access to most releases from R52x, on multiple platforms.
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003
The error you are getting is (as Karen states) because you do not have a field named FEB in your MFD, so to display the value of a variable in a TABLE request you will need to place it into a COMPUTED field -
TABLE FILE file PRINT CC_KEY TIME_KEY COMPUTE DISP_DATE/A6 = '&SHOWDT2.EVAL'; ON TABLE NOTOTAL END
I'm sorry but it was bugging me that using &DATEMT was not suggested. No criticism intended to other solutions posted. I just wanted to mention the &DATEMT because we all are always look for the least amount of code to accomplish a task. The '.EVAL' is not needed either in the code above.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
Thank you Mickey...any shortcuts are greatly appreciated!
I think I've managed to confuse what the need is. I had pulled the variable in the report to make sure its calculating correctly, which I should have done with the ECHO as noted by Karen/Piipster..(thanks!), however what I really need is to only select those records where the variable matches the time_key.
Ok, so going with a portion of the code suggested by Mickey I modified it to use the variable in the where statement and receive the following error message.
0 ERROR AT OR NEAR LINE 6 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: FEB BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Code: -SET &SHOWDT = &DATEMT | '-' | &DATEY;
TABLE FILE file PRINT CC_KEY TIME_KEY WHERE &SHOWDT EQ TIME_KEY; ON TABLE NOTOTAL END
What am I missing here? Am I using funtionality that is not suitable to the need?
Forgive me for my ignorance and thank you for your patience. I've only been using this tool for a few months and have very little development background...if you couldn't already tell .
Let me see if I can explain this with as few words as possible.
To fix your code, flip-flop the &SHOWDT and the TIME_KEY in your WHERE statement. Then, put single quote marks around &SHOWDT.
This is what is happening. Whenever FOCUS sees an &variable it takes the value for the variable and sticks it in where the variable name is. In your case FEB-06 is put in the statement so it looks like this:
WHERE FEB-06 EQ TIME_KEY;
Now the WHERE statement is very flexible but if something does not have quotes around it, it will think it is a fieldname. Since FEB-06 does not have quotes around it, it looks for a field with this name instead of treating it as a value.
Dialogue MAnager variables (the ones with & or &&) are used to dynamically put a character string into a piece of code. After all the variables have been resolved, it then evaluates the statement.
This is a generalized explanation of a more complicated and very powerful feature of the FOCUS language.
I hope this helps.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003