How to converts a character to decimal on progress 4GL?

Thiru
DEFINE VARIABLE cDateTime AS CHARACTER NO-UNDO.

DEFINE TEMP-TABLE tt_data NO-UNDO
    FIELD DateTime   AS DECIMAL FORMAT "->>,>>9.99".

ASSIGN
cDateTime = "20191604121566".

CREATE tt_data.
ASSIGN
tt_data.DateTime = DECIMAL(cDateTime) /* Message Date and Time */

But it says:

"Value cannot be displayed using ->>>,>>>,>>9.999999".

Could you please help this case and tell me what is wrong here?

Tom Bascom

The code that you show does not result in the error that you are reporting.

I'm guessing that you have a DISPLAY statement somewhere in your real code.

The reported error simply means that that DISPLAY format is not wide enough for the data. By default DISPLAY will use whatever format you specified in the definition of a data element. If you did not specify anything then every datatype also has a default. For decimals the default is "->>,>>>.99".

You can either increase the format in the definition or override it in the display statement like so:

display tt_data.DateTime format ">>>>>>>>>>>>>>>9". 

Note: the display format has no influence on the values that you can store in a field. You can always "overstuff" more data into a variable than you can display. The format is only for output display purposes -- it has nothing to do with storage.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to make a multidimensional array in Progress 4GL?

How to assign content of a file to a string variable in progress openedge 4gl?

How to read a XML file and export an item using Progress 4GL

How to store the data in database in chinese language on progress 4gl?

How do I call the procedure section from window application using asynchronous method on progress 4GL?

How to rethrow caught exception in progress 4gl?

How to export xml file in progress 4gl?

How to send a SOAP headers in Progress 4GL

Progress 4GL: How to generate different log file name when multiple processes using the same Timestamp?

How to list all lines in a field with Progress 4GL

How can I access more than 1 element from a field in Progress 4GL

How to test if string is numeric using Progress 4GL

Datatype in progress 4gl

how to use Array of decimal in 4GL

How can i get the same result in Progress 4gl?

Progress 4GL: How to find where a procedure is defined

How to match a records in progress 4GL?

How to calculate yesterday records with today records using progress 4gl?

** Invalid character in numeric input /. (76) - PROGRESS 4GL

How to implement NOT EXISTS in OPEN QUERY statement in PROGRESS 4GL - OpenEdge 10.2A

How to fix Dynamic Query error for progress 4gl?

How fast can a file be written/read by progress 4GL program?

How to get the last comma separated data stored in a variable? - Progress 4gl

How add only required fields from table to dynamic temp table? - PROGRESS 4GL

How to hide form fields data? - PROGRESS 4GL?

how to add and display specific records from code_mstr to temp-table in progress 4gl?

how to create a temp-table for code_mstr in progress 4gl?

how to apply last key from a program itself without requiring a user input? - PROGRESS 4GL

How to get chosen value from combo-box as variable PROGRESS 4GL