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     Defining a Date Field for a DBF output.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Defining a Date Field for a DBF output.
 Login/Join
 
<José Andrés Vargas Aguilar>
posted
Hy, I need to PRINT a date field on a DBF file.

I've tried with the following code's and functions and neither of them works:

-* FECHA/DMYY=HDATE(FECH,'DMYY');
-* FECHA/DMYY=HDATE(FECH,'D|M|YY');
-* FECHA/DMYY='&wf_fchref';
-* FECHA/HYYMDS = HDTTM(FECH,8,'HYYMDS');
-* FECHA/A8 = FECH;
-* FECHA/I8 MISSING ON NEEDS ALL = HPART(FECH,'DATE','I8');
-* FECHA/HYYMDS = DT(FECH);

... Being FECH the date field retrieved from my ORACLE PL/SQL query and FECHA the name of the field I'll print to the DBF file. Al that code has been tested (obviusly without the -* ) on a DEFINE and then using PRINT on my DBF.

When I open the DBF on MS Access I get a Numeric field on the DBF on most of the cases and on some of them I get an error data type.

The date can also be read on the &wf_fchref string parameter, it's a constant value on the fex.

So, can anyone tell me how to print the date from FECH or &wf_fchref into the DBF please?

Thanks!

This message has been edited. Last edited by: <José Andrés Vargas Aguilar>,
 
Report This Post
Expert
posted Hide Post
-SET &WF_FCHREF = &YYMD;

DEFINE FILE CAR
DTTM1/HYYMDS = DT(&WF_FCHREF 00:00:00.000);
DTTM2/A20 = HCNVRT(DTTM1, '(H17)', 17, 'A20');
DTTM3/A20 = HCNVRT(DTTM1, '(HYYMDS)', 20, 'A20');

END

TABLE FILE CAR
PRINT 
DTTM1 
DTTM2
DTTM3
BY COUNTRY
END


Result:

 PAGE     1
 
 
 COUNTRY     DTTM1                DTTM2                 DTTM3
 -------     -----                -----                 -----
 CANADA      2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00
 ENGLAND     2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00
 FRANCE      2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00
 ITALY       2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00
 JAPAN       2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00
 W GERMANY   2010/05/12 00:00:00  20100512000000000     2010/05/12 00:00:00

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<José Andrés Vargas Aguilar>
posted
Francis thanks.

Maybe I wasn't clear enough. &wf_fchref isn't today's date. It's a string that my report gets when getting called and that represents the date I use to retrieve data on a SQL.

On the DBF It must be "PRINTED" as a Date. The code you gave prints a Text. This is the adaptation of your code:
   

-DEFAULT &wf_fchref  = '05-01-2010';

-SET FECFILE = 'testing' ;
-SET FECFILEO= 'testing' | '.DBF';

-SET papp = 'cachebw';
-SET pdire = &APPROOT;

DEFINE FILE CAR
DTTM1/HYYMDS = DT(&wf_fchref 00:00:00.000);
BTN/A500='Download file here: <a href=''/approot/&papp/&FECFILE''>&FECFILE</a>';
END

TABLE FILE CAR
PRINT
DTTM1 AS 'DATE'
COUNTRY

ON TABLE HOLD AS &FECFILE FORMAT DBASE
END

-RUN

-TYPE &FECFILEO
-TYPE &FECFILE

-SET &pfdele = &pdire | '\' | &papp | '\' | &FECFILEO;
-SET &pfcopy = &pdire | '\' | &papp | '\' | &FECFILE;

-TYPE Archivo a Borrar &pfdele
-TYPE Archivo a Copiar &pfcopy

-WINNT DEL &pfcopy
-WINNT COPY &pfdele &pfcopy

TABLE FILE CAR
PRINT
DTTM1 AS 'DATE'
COUNTRY

HEADING
"<BTN"

END

 
Report This Post
Expert
posted Hide Post
My code is an example.

There's not much difference between
-SET &WF_FCHREF = &YYMD;
and
-DEFAULT &wf_fchref  = '05-01-2010';
- I am just setting a Dialogue Manager string.

"On the DBF It must be "PRINTED" as a Date" - Perhaps WebFOCUS cannot create a Date-Time field for DBF or DBASE. None of my attempts below produce a Date column in MS Access.

-DEFAULT &WF_FCHREF  = '05-01-2010';

-SET &WF_FCHREF1 = EDIT(&WF_FCHREF,'99$99$9999');

-SET FECFILE = 'TESTING' ;

APP HOLDDATA TEST
-RUN

DEFINE FILE CAR
DTTM1/HYYMDS = DT(&WF_FCHREF 00:00:00.000);
DTTM2/A20 = HCNVRT(DTTM1, '(H17)', 17, 'A20');
DTTM3/A20 = HCNVRT(DTTM1, '(HYYMDS)', 20, 'A20');
DT1/DMYY = DATECVT(&WF_FCHREF1, 'I8DMYY', 'DMYY');
DT2/A10 = EDIT('&WF_FCHREF1','99/99/9999');
DT3/A8DMYY = EDIT('&WF_FCHREF1','99999999');

END

TABLE FILE CAR
PRINT
DTTM1
DTTM2
DTTM3
DT1
DT2
DT3
COUNTRY

ON TABLE HOLD AS &FECFILE FORMAT DBASE
END
-RUN


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
DT1 in this example seems to generate a Date field in MS Access:

-SET &ECHO=ALL;

-DEFAULT &WF_FCHREF  = '05-01-2010';

-SET &WF_FCHREF1 = EDIT(&WF_FCHREF,'99$99$9999');

-SET FECFILE = 'TESTING' ;

APP HOLDDATA TEST
-RUN

DEFINE FILE CAR
DTTM1/HYYMDS = DT(&WF_FCHREF 00:00:00.000);
DTTM2/A20 = HCNVRT(DTTM1, '(H17)', 17, 'A20');
DTTM3/A20 = HCNVRT(DTTM1, '(HYYMDS)', 20, 'A20');
DT1/YYMD = DATECVT(&WF_FCHREF1, 'I8DMYY', 'YYMD');
DT2/A10 = EDIT('&WF_FCHREF1','99/99/9999');
DT3/A8DMYY = EDIT('&WF_FCHREF1','99999999');

END

TABLE FILE CAR
PRINT
DTTM1
DTTM2
DTTM3
DT1
DT2
DT3
COUNTRY

ON TABLE HOLD AS &FECFILE FORMAT DBASE
END
-RUN


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<José Andrés Vargas Aguilar>
posted
This last one did it Francis, thanks!
 
Report 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     Defining a Date Field for a DBF output.

Copyright © 1996-2020 Information Builders