Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

DBACCESS POWERCOBOL AND NUMERIC FIELD
Hello,
I USE DBACCESS OCX FOR READ or write A MSACCESS TABLE.
IT WORK CORRECTLY BUT NOT WORK ON FIELD  DEFINED :
NUMERIC
PRECISION 13
SCALE 2

POWERCOBOL DEFINE A FIELD S9(11)v99 but not read the field and not
write the record.

The code is

ENVIRONMENT     DIVISION.
DATA            DIVISION.
WORKING-STORAGE SECTION.
01 WorkLvl pic 9(4) comp-5.
01 CONTA        PIC 999 VALUE ZERO.
01 CAMPO1     PIC s9(14)v9999 .
PROCEDURE       DIVISION.
LLOP.
ADD 1 TO CONTA.
IF CONTA > 10 GO FINE.
*
MOVE CONTA  TO "CODICE" OF DB-Jobs-Database.
MOVE "PIPPO"      TO "DESCIRIZIONE" OF DB-Jobs-Database.
MOVE +123,45 TO CAMPO1.
*
MOVE campo1 TO "IMPORTO" OF DB-Jobs-Database.
MOVE "2005/05/25" TO "DATAE"  OF DB-Jobs-Database.
INVOKE DB-Jobs-Database "WriteRecord".
GO LLOP.

FINE.

INVOKE DB-Jobs-Database "CloseDB".

Tanks in advance


Report this thread to moderator Post Follow-up to this message
Old Post
ramzenit
05-11-05 01:55 AM


Re: DBACCESS POWERCOBOL AND NUMERIC FIELD
Thanks,
but not is this the problem.
On windows upper and lowercase   is the same.
The problem is field structure.
on decimal field not work!!.

Robert Jones ha scritto:
> Hello Ramzenit,
>
> I don't know PowerCOBOL, but your definition "CAMP01" is slightly
> different from  the name "campo1" in the MOVE statement.  While COBOL
> should translate between upper and lowercase OK, it looks as though
> there is a zero in the definition and a letter 'o' in the name used
in
> the MOVE.  I am surprised that the program got through the compiler,
> but maybe Powercobol interprets rather than compiles.
>
> Robert


Report this thread to moderator Post Follow-up to this message
Old Post
ramzenit
05-11-05 01:55 AM


Re: DBACCESS POWERCOBOL AND NUMERIC FIELD
Check that you have "decimal point is comma" in the environment division.

Make sure that your database definitions are compatible with the definitions
in WS.

Numeric fields cannot be more than s9(14)v9(4).

You cannot use binary fields.

"ramzenit" <mbazan@tin.it> wrote in message
news:1115453667.153576.17870@o13g2000cwo.googlegroups.com...
> Hello,
> I USE DBACCESS OCX FOR READ or write A MSACCESS TABLE.
> IT WORK CORRECTLY BUT NOT WORK ON FIELD  DEFINED :
> NUMERIC
> PRECISION 13
> SCALE 2
>
> POWERCOBOL DEFINE A FIELD S9(11)v99 but not read the field and not
> write the record.
>
Where is this field defined? I don't see it below.

> The code is
>
>  ENVIRONMENT     DIVISION.
>  DATA            DIVISION.
>  WORKING-STORAGE SECTION.
>  01 WorkLvl pic 9(4) comp-5.
>  01 CONTA        PIC 999 VALUE ZERO.
>  01 CAMPO1     PIC s9(14)v9999 .
>  PROCEDURE       DIVISION.
>  LLOP.
>      ADD 1 TO CONTA.
>      IF CONTA > 10 GO FINE.
> *.
>      MOVE CONTA  TO "CODICE" OF DB-Jobs-Database.

Make sure you have connected to the database and specified the table you
want. You cannot reference database fields in the DB Object in the way you
are doing here. What is DB-Jobs-database? It cannot be a PowerCOBOL DB
connection object because that object does not have these properties...

>      MOVE "PIPPO"      TO "DESCIRIZIONE" OF DB-Jobs-Database.
>      MOVE +123,45 TO CAMPO1.
> *
>      MOVE campo1 TO "IMPORTO" OF DB-Jobs-Database.
>      MOVE "2005/05/25" TO "DATAE"  OF DB-Jobs-Database.
>      INVOKE DB-Jobs-Database "WriteRecord".

This is a method of the PowerCOBOL connection object. But your field
references are not to properties of it.

Something is very wrong here...

>      GO LLOP.

It LOOKS as if you have a reference to a table on a database and that
reference is called DB-Jobs-Database.

How did you get it?

Please post your code if you want proper analysis.


>
>  FINE.
>
>      INVOKE DB-Jobs-Database "CloseDB".
>
> Tanks in advance
>
>
...followed by the infantry...

Pete.




Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
05-11-05 01:55 AM


Re: DBACCESS POWERCOBOL AND NUMERIC FIELD
OK, I was puzzled by your problem and so I loaded the OCX into a PowerCOBOL
form and read the docs on it. I see now how you are referencing the fields.

Try defining fields that require a decimal as 'currency' on the ACCESS DB.
That worked for me. It is a clumsy workaround but for most commercial work
you never need more than 4 places.

A better solution is to move to MySQL as your database :-) (That's what I
did after using ACCESS for years; never regretted it.)

Pete

<snipped>




Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
05-11-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:48 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.