NUMERIC to COMP-3 move

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Posts: 1
Joined: Mon Mar 22, 2010 1:42 am

NUMERIC to COMP-3 move

Post by mainsm » Mon Mar 22, 2010 1:46 am

Hi All,

Am trying to move a numeric data item to COMP-3 variable... 9(13) to s9(13)v comp-3... Am using that COMP-3 variable to insert a record in the table. Am getting -310 SQL error code while doing so (DECIMAL HOST VARIABLE OR PARAMETER number CONTAINS NON-DECIMAL DATA) which means, the MOVE from numeric to COMP-3 is invalid.

Please provide ur suggestions.

User avatar
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Mar 29, 2010 2:45 pm

do you only have one numeric column in your ROW?

if you do not have a debugger, suggest you that you use DISPLAY verb to display the values of the host variable immediately before your SQL INSERT.

and your statement
which means, the MOVE from numeric to COMP-3 is invalid.
is not true
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai

Post by Natarajan » Mon Mar 29, 2010 10:50 pm

I dont see any issue moving numeric data (i.e, 9(13)) to comp-3 decimal variable.

1) Make sure you have valid data in numeric vairable.
2) Are you using autogenerated DCL variable (or) you have declared your
own host variable?

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others