A Table feild is declared as Decimal(7,2). I want to insert
the decimal in to this column thru cobol-db2 program.
How should I declare my local input file variable
or any suggestion?

Answers were Sorted based on User's Feedback



A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / rajesh

u can declare in application program(cobol)
01 dec pic 9(5)v9(2) comp-3. is equal to dec(7,2)

Is This Answer Correct ?    16 Yes 4 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / prabhakar

u can declare in application program(cobol)
01 dec pic 9(5).9(2). is equal to dec(7,2)

Is This Answer Correct ?    11 Yes 5 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / sumanth toom

hmmm..depends how you want to use that variable.
9(5).99 is an edited field. Probably used for printing or
reporting purposes.

Otherewise, 9(5)V99 can be used.

Is This Answer Correct ?    5 Yes 1 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / nitin

Hello Sumanath and Rajesh

No declaring 9(5)V99 / 9(5)v9(2) comp-3 this way was
not working. I tried this also.

For Example: if the input is 123.45 from flat file
and 1. If I declare 01 W-var pic 9(5)V99
then value of W-var will be 123 45 (It assumed space at
place of decimal) and the same value 123 45 it tried to
moved in the db2 table host varible. which in turn throw
SOC7.

Is This Answer Correct ?    2 Yes 1 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / nitin

Thanks... Prabhakar
This works

Is This Answer Correct ?    2 Yes 2 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / baalu

hello, nitin...
try this one s9(7-2)v9(2)comp-3
this is similor to s9(x-y)v9(y) comp-3



with best regards,
baalu.

Is This Answer Correct ?    1 Yes 1 No

A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cob..

Answer / mf_nerd

PIC S9(5)V99 COMP-3.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is the function of the Data Manager?

2 Answers  


What is the function of buffer manager?

1 Answers  


what is the input to PLAN? what is the input to DBRM?

4 Answers  


Is it Possible to declare or create a cursor for UPDATE of table? If yes tell me how? If no Tell me why?

1 Answers   IBM, scintel,


What is the latest version of ibm db2?

0 Answers  






Define check constraint.

0 Answers  


What is ibm db2 database?

0 Answers  


What is the use of runstats in db2?

0 Answers  


Are views updatable ?

4 Answers  


Suppose there are many duplicate records in a Db2 table. What is the query to retrive only duplicate records?

4 Answers  


Generally if I want to select the names starting with c I need to use c% But how could I code to select the data which contains % as a part of data.

5 Answers  


a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.

3 Answers  


Categories