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.
Please forgive the low skill level I'm sure to exhibit here.
I'm trying to convert an A10 field to HYYMDs format. Unfortunately, the A10 field is in the Day/Month/Year format, while it seems HINPUT is expecting Month/Day/Year formatting. This throws HINPUT for a loop, as it doesn't know how to react (I haven't told it how to react, more accurately) when it gets any value >12 when it's expecting a Month.
So, I embarked on the journey of pulling the different digits out of the original A10, reversing them, and concatenating them.
This involved an 8 step process, in 8 different Defined fields.
Pull out the Month Pull out the Day Pull out the Year Concatenate the Month and a '/' Concatenate the Day and a '/'\ Concatenate the new Month and Day fields Concatenate the new Month/Day/ with Year HINPUT on the newly created A10 date field
I KNOW there is an easier way to do this.
1) Is there a way to declare and use temporary variables within the body of a defined field so I can combine some of these steps? 2) Is there a way to concatenate more than two fields at a time? The only function that I saw (CONCAT) only allowed two arguments to be concatenated in each step. 3) Is there a way to tell HINPUT to reverse it's normal expectation of Month/Date?
While you may be able to solve the problem for me by answering number three alone, I think the answers to questions one and two would be helpful as I'm still trying to learn the basics here, obviously.
P.S. I realize my solution above is laughable! That's why I'm here, this can't possibly be the best way to solve this problem, even if it gets the job done.This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013
Here is an example of how turn an alpha column into a Date-Time column. It requires two steps - one to convert the alpha column to a DATE column, one to convert the DATE column to a DATE-TIME column.
DEFINE FILE CAR
DATE1/A10 = '21/09/2016';
END
TABLE FILE CAR
PRINT
DATE1
COMPUTE DATE1A/YYMD = DATECVT(EDIT(DATE1,'99$99$9999'), 'A8DMYY', 'YYMD');
COMPUTE DATE1B/HYYMDS = HDTTM(DATE1A, 8, 'HYYMDS');
BY COUNTRY
END
Yes, it seems strange that HINPUT cannot use MMDDYYYY input...This message has been edited. Last edited by: Francis Mariani,
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
You can do it one step, though it would be very difficult to read:
DEFINE FILE CAR
DATE1/A10 = '09/21/2016';
END
TABLE FILE CAR
PRINT
DATE1
COMPUTE DATE1B/HYYMDS = HDTTM( DATECVT( EDIT(DATE1,'99$99$9999'), 'A8MDYY', 'YYMD' ), 8, 'HYYMDS' );
BY COUNTRY
END
This message has been edited. Last edited by: Francis Mariani,
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
...the A10 field is in the Day/Month/Year format, while it seems HINPUT is expecting Month/Day/Year formatting...
To change this expectation, it looks like you can change the setting of DATEFORMAT from MDY (US English default) to DMY.
For example:
SET DATEFORMAT = DMY
SET ONLINE-FMT = STANDARD
DEFINE FILE CAR
CN_DATE/A10 WITH COUNTRY = '28/03/2017';
DTETME_FROM_ALPHA/HYYMDS = HINPUT(10, CN_DATE, 8, 'HYYMDS');
END
TABLE FILE CAR
PRINT
CN_DATE
DTETME_FROM_ALPHA
IF RECORDLIMIT EQ 1
END
SET DATEFORMAT = MDY
Thank you for the solutions. I can follow the syntax and the logic of what you both are suggesting.
I really hate to beleaguer the point, as you have both given me solutions, but have one more question:
How I translate this syntax, which I believe is native WebFocus Language, into the InfoAssist tool? Is there some documentation I could look at to explain what the differences in syntax are?
I know that learning the code is much more useful / powerful than relying on a tool, unfortunately I'm going to have to deploy the tool to other analysts in the future and will have a hard enough time getting them to learn the tool, and no chance on code.
Thank you again for taking the time to help.
WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013
There is definitely the way to do Detail(Defines), that's where I did all of the steps I mentioned in my original posts.
It just seems like InfoAssist places limitations on what can be entered in this area. I will do some more searching of the InfoAssist documentation to see what differences there are.
If someone else is most familiar w/ InfoAssist and has knowledge about these differences, please let me know! I'll leave this open for awhile longer and then change it to solved if I don't any more responses re: InfoAssist.
Thank you both for your help.
WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013