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.
Hi I am having a date input in alphanumeric(A9)format like 15-Oct-07 but in my report O/P i need to diplay like 10/15/2007. I tried the below code and it works fine.But when i give my field name it is not working.
Is it a column from a table or is it a Dialogue Manager variable?
If it's a column of a table, what error do you get? Perhaps the size of the column is larger than 9 characters. If so, use EDIT or SUBSTR to extract the first 9 characters.
If it's a Dialogue Manager variable, this should work:
-SET &DATE1 = '15-Oct-07';
DEFINE FILE CAR
TEST_DATE/A9='&DATE1';
GET_MONTH/A3=EDIT(TEST_DATE,'$$$999');
MONTH/A2= DECODE Get_Month ('Jan' '01' 'Feb' '02' 'Mar' '03' 'Apr' '04' 'May' '05' 'Jun' '06'
'Jul' '07' 'Aug' '08' 'Sep' '09' 'Oct' '10' 'Nov' '11' 'Dec' '12' ELSE ' ');
DAY/A2=EDIT(TEST_DATE,'99');
YEAR/A2=EDIT(TEST_DATE,'$$$$$$$99');
ALPHA_DATE/A8MDYY = Month | Day |'20'| Year;
FINAL_DATE/MDYY = ALPHA_DATE;
END
TABLE FILE CAR
PRINT
COUNTRY NOPRINT
TEST_DATE MONTH DAY YEAR ALPHA_DATE FINAL_DATE
END
-RUN
What error do you get exactly?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Actually it is a column read from external CSV file.In the file it is in 1-Oct-07,15-Oct-07 etc etc.. format.So inorder to read it i have used A9 in master file.
TABLE FILE ONE PRINT Get_Month Month Day Year ALPHA_DATE FINAL_DATE BY ASSET_ID END -RUN -EXIT
:::::error::::: 0 ERROR AT OR NEAR LINE 353 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TDate 0 ERROR AT OR NEAR LINE 355 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TEST_DATE 0 ERROR AT OR NEAR LINE 357 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: Get_Month 0 ERROR AT OR NEAR LINE 363 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TEST_DATE 0 ERROR AT OR NEAR LINE 365 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: Month 0 ERROR AT OR NEAR LINE 367 IN PROCEDURE MEMFEX FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: ALPHA_DATE 0 ERROR AT OR NEAR LINE 405 IN PROCEDURE MEMFEX FOCEXEC * (FOC003) THE FIELDNAME IS NOT RECOGNIZED: Get_Month BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Could you post your master file for ONE? About the only explanation for the error you're getting is the one offered by Francis. Possibly you have more than one copy of it in your server path.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
If your date is coming in as 1-Oct-07 or 15-Oct-07 then a fixed length field substring is not going to help you one bit (Get_Month/A3=EDIT(TEST_DATE,'$$$999')) as in the first date the value for Get_Month would be "ct-" and the second would be OK.
Try using GETTOK for the components. I would have suggested using STRREP to change the hyphens to slashes but STRREP objects to the '-' as a parameter as either change string.
Fixed length it is not, so standard editing would not work here. Also as pointed out by Tony using a '-' is not a recommended practice b/c given the wrong scenario it could be misunderstood to be a minus sign in a calculation. Fixed format would be the best case to work with. Tony's suggestion right on the mark.
You might be able to do the extract from the other system with WF. If that field is a real date field in the database you would be in charge and be able to convert it at the extraction moment.
Just a thought.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
I am not incharge of the extraction process. I just get the CSV file and i start working on it.Can make this as a suggestion to other members incharge of making the extract from that system.It will also be helpfull in future.
I wonder if someone can explain the following. If you do the following, it works:
DEFINE FILE XXX
DATE1/MDYY='15 OCT 07';
END
But this doesn't work.
Also, to get this to work, one has to make sure the DEFCENT and YRTHRESH are properly set.
DEFINE FILE XXX
DATE1/A9='15 OCT 07';
DATE2/MDYY=DATE1;
END
It seems if I use a date literal, I can convert the literal to a smart date. I don't have to do all the DECODE, Concatenation, etc. But if I use a field that contains a date literal, I cannot, unless I parse the components. I don't know about you guys, but this seems like a bug to me.
In Umar's problem, say TDATE contains '15-OCT-07', then the following should work.