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     solve NUmber to Alphanumeric conersion error|Error in EDIT&in using IF loop in DEFINE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
solve NUmber to Alphanumeric conersion error|Error in EDIT&in using IF loop in DEFINE
 Login/Join
 
Gold member
posted
Hi,

I am trying to implement the following. But in ouput excel it is giving ******** in the required field.

DEFINE FILE AAAA
DATEA/A10 = TODAY(DATEA);
DATEH/HDMYYS = HINPUT(10, DATEA, 8, 'HDMYYS');
D_TOD/YYMD=HDATE(DATEH,'YYMD');
DATE_SER/YYMD MISSING ON = HDATE(BASE_SERVICE_DT,'YYMD');
-* SERV_YRS1/I8 = DATEDIF(DATE_SER,D_TOD,'Y');
SERV_YRS/A10 = IF DATE_SER IS MISSING THEN ' ' ELSE FTOA(DATEDIF(DATE_SER,D_TOD,'Y'), '(A10)', SERV_YRS);
-*
EMPL_STATUS/A34 = IF L9SF_EMPL_STATUS = ' ' THEN ' '
ELSE EDIT(L9SF_EMPL_STATUS,'9') |' - '| L9SF_EMP_STAT_DESC;
END
-RUN

TABLE FILE AAAA
PRINT SERV_YRS
EMPL_STATUS
ON TABLE PCHOLD AS WFGN FORMAT EXL2K
END
-RUN
-*
-*
-EXIT

It is not giving any error but in ouput excel all required row don't have data instead it is showing as ********.

Please suggest were I am going wrong?

This message has been edited. Last edited by: Kerry,


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Report This Post
Virtuoso
posted Hide Post
Comment out your ON TABLE PCHOLD statement and allow WebFOCUS to generate the output in HTML format. Also put an ECHO statment at the top of the program. These steps should allow you to see any errors generated and determine if reasonable output is being produced before moving to Excel output.

-SET &ECHO=ALL;
.
.
.
-*ON TABLE PCHOLD AS WFGN FORMAT EXL2K
.
.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
<JG>
posted
AS a starting point
FTOA is used for Decimal values not Alpha
DATEDIF returns Integer values not Alpha

Also do not use '=' instead of 'EQ' in defines and computes, it's not correct and although it might work today chances are it will not in the future
 
Report This Post
Gold member
posted Hide Post
I tried Dan's steps, but was not successful, it gave starred output in html too without any error.

As JG suggested i made my define more simple as below

DEFINE FILE AAAA
DATEA/A10 = TODAY(DATEA);
DATEH/HDMYYS = HINPUT(10, DATEA, 8, 'HDMYYS');
D_TOD/YYMD=HDATE(DATEH,'YYMD');
DATE_SER/YYMD MISSING ON = HDATE(BASE_SERVICE_DT,'YYMD');
SERV_YRS/I8 = IF DATE_SER IS MISSING THEN ' ' ELSE DATEDIF(DATE_SER,D_TOD,'Y');
-*
EMPL_STATUS/A34 = IF L9SF_EMPL_STATUS = ' ' THEN ' '
ELSE EDIT(L9SF_EMPL_STATUS,'9') |' - '| L9SF_EMP_STAT_DESC;
END
-RUN

TABLE FILE AAAA
PRINT SERV_YRS
EMPL_STATUS
ON TABLE PCHOLD AS WFGN FORMAT EXL2K
END
-RUN
-*
-*
-EXIT

But it gave format compatability error stating SERV_YRS is not compatible, but then I tried as below
DEFINE FILE AAAA
DATEA/A10 = TODAY(DATEA);
DATEH/HDMYYS = HINPUT(10, DATEA, 8, 'HDMYYS');
D_TOD/YYMD=HDATE(DATEH,'YYMD');
DATE_SER/YYMD MISSING ON = HDATE(BASE_SERVICE_DT,'YYMD');
SERV_YRS/I8 =DATEDIF(DATE_SER,D_TOD,'Y');
-*
EMPL_STATUS/A34 = IF L9SF_EMPL_STATUS = ' ' THEN ' '
ELSE EDIT(L9SF_EMPL_STATUS,'9') |' - '| L9SF_EMP_STAT_DESC;
END
-RUN

TABLE FILE AAAA
PRINT SERV_YRS
EMPL_STATUS
ON TABLE PCHOLD AS WFGN FORMAT EXL2K
END
-RUN
-*
-*
-EXIT
it ran properly and gave me output, but not as per the requirement, even for rows which don't have BASE_SERVICE_DT had some value as 109.

Any suggestion of what could be wrong with the IF loop in DEFINE


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Report This Post
<JG>
posted
quote:
109


A magic number, or rather the result of 2010 - 1901

MISSING is not valid in DATEDIF and I suspect treated as the WebFOCUS base year.

try

SERV_YRS/I8 = IF DATE_SER IS MISSING THEN 0 ELSE DATEDIF(DATE_SER,D_TOD,'Y');
 
Report This Post
Gold member
posted Hide Post
quote:
SERV_YRS/I8 = IF DATE_SER IS MISSING THEN 0 ELSE DATEDIF(DATE_SER,D_TOD,'Y');



Thank you. It worked. It was simple logic, which I missed.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
 
Posts: 50 | Registered: August 04, 2009Report This Post
Expert
posted Hide Post
FYI

If you get ******** in relation to a number, usually means that the number is too big for the field format size.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
MKS,

Fix the syntax errors as JG identified to avoid unexpected results.

In my experience(hope you gurus will validate this for me), that it is almost always not a good time to test for missing values in DEFINE. I have better luck with COMPUTE or put it in the hold file first. Confused

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report 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     solve NUmber to Alphanumeric conersion error|Error in EDIT&in using IF loop in DEFINE

Copyright © 1996-2020 Information Builders