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     [SOLVED] How to pass data to a MODIFY on a FOCUS DB with HYYMDS field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to pass data to a MODIFY on a FOCUS DB with HYYMDS field
 Login/Join
 
Expert
posted
I have a FOCUS DB that contains an HYYMDS field.

I'd like to use MODIFY to insert rows into this DB. I'm having trouble formatting the input data for this field.

-SET &ST_DATE = EDIT(&YYMD,'9999/99/99');
-SET &ST_TIME = EDIT(HHMMSS('A8'),'99$99$99');

-SET &EN_DATE = EDIT(&YYMD,'9999/99/99');
-SET &EN_TIME = EDIT(HHMMSS('A8'),'99$99$99');

MODIFY FILE FOCDB1
FREEFORM ST_DTTM/17
FREEFORM EN_DTTM/17

DATA
ST_DTTM=&ST_DATE &ST_TIME,
EN_DTTM=&EN_DATE &EN_TIME,$
END

With this code, I get this error:

(FOC210) THE DATA VALUE HAS A FORMAT ERROR: 2011/05/11 142011

Any ideas?

Thanks,

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
Expert
posted Hide Post
I would prefer not to do it this way, but I can make it work by creating an intermediary HOLD file:

-SET &ST_DATE = &YYMD;
-SET &ST_TIME = EDIT(HHMMSS('A8'),'99$99$99');

-SET &EN_DATE = &YYMD;
-SET &EN_TIME = EDIT(HHMMSS('A8'),'99$99$99');

SET HOLDFORMAT=ALPHA
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY

TABLE FILE CAR
PRINT COUNTRY NOPRINT
COMPUTE ST_DTTM1/A14   = '&ST_DATE' | '&ST_TIME'; NOPRINT
COMPUTE ST_DTTM/HYYMDS = HINPUT(14, ST_DTTM1, 8, 'HYYMDS');
COMPUTE EN_DTTM1/A14   = '&EN_DATE' | '&EN_TIME'; NOPRINT
COMPUTE EN_DTTM/HYYMDS = HINPUT(14, EN_DTTM1, 8, 'HYYMDS');
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS H001
END
-RUN

MODIFY FILE FOCDB1
FIXFORM FROM H001
DATA ON H001
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
Virtuoso
posted Hide Post
The time needs to have ':' in for correct format.
APP FI MASTER DISK DB1.MAS
-RUN
-WRITE MASTER FILENAME=DB1, SUFFIX=FOC     , $
-WRITE MASTER   SEGMENT=SEG, SEGTYPE=S1, $
-WRITE MASTER     FIELDNAME=KEY, USAGE=A1, $
-WRITE MASTER     FIELDNAME=DATE, USAGE=HYYMDS, $

CREATE FILE DB1

-SET &ST_DATE = EDIT(&YYMD,'9999/99/99');
-SET &ST_TIME = EDIT(HHMMSS('A8'),'99$:99$:99'); 

-SET &EN_DATE = EDIT(&YYMD,'9999/99/99');
-SET &EN_TIME = EDIT(HHMMSS('A8'),'99$:99$:99'); 

MODIFY FILE DB1
FREEFORM KEY DATE
DATA
A,&ST_DATE &ST_TIME,$
B,&EN_DATE &EN_TIME,$
END
-RUN
TABLE FILE DB1
PRINT *
END


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Alan,

Than works perfectly!

Thanks very much.


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
Thats interesting Alan, I was not aware that you could get a Datetime field populated directly from the FREEFORM.

My code was similar to Francis'.

Good One


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to pass data to a MODIFY on a FOCUS DB with HYYMDS field

Copyright © 1996-2020 Information Builders