View previous topic :: View next topic
|
Author |
Message |
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Hi,
We are trying to download data from the DB2 table. Previously we used to download the data directly from the table. Since this used to require huge amount of CPU time, we are planning to download the data from the image copy of the table instead.
However, when we are unloading data from the image copy, a column having definition of DECIMAL(7,0) when unloaded is having a junk value of X'40404040' instead of X'00000000' which leads to a downstream COBOL program getting abended with S0C-7 abend.
Is there any method by means of which we can easily download data from the image copy but would be having the desired value of X'00000000' instead of X'40404040'. The copy book definition of this particular field is PIC S9(7)V COMP-3. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Are you sure that data for that column in Image copy (IC) was "correct" at the time of IC itself? |
|
Back to top |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Yes, Anuj.
After we had performed the unload, we loaded the same data into another database and then compared both the tables. Both had similar records.
I put a validation in my COBOL program that checked the NULL Indicator value as X'FF'. Is such kind of comparison allowed in COBOL?
Code: |
05 WC-UNLOAD-NULL-FIELD PIC X(01) VALUE X'FF'.
IF COLA-NULL NOT = WC-UNLOAD-NULL-FIELD
AND COLA NOT = ZERO
|
I am performing the check above. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Swapnadeep Ganguly,
Quote: |
a column having definition of DECIMAL(7,0) when unloaded is having a junk value |
Those are not JUNK value. Those are binary.
In you unload job add this too.
Code: |
FROM TABLE HQlevel.tablename
(COL1,COL2,COL3 DECIMAL EXTERNAL) |
This will give you in a readable format.
Thank You,
Sushanth |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi
Quote: |
Those are not JUNK value. Those are binary. |
Quote: |
However, when we are unloading data from the image copy, a column having definition of DECIMAL(7,0) when unloaded is having a junk value of X'40404040' instead of X'00000000' |
I think X'40404040' is neither junk nor binary. It is the representation of "space " or "blank" in HEX.
If I am not correct, correct me.
Regards
Raghu |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Raghu,
I read in the documentation the following.
Quote: |
When you unload a floating-point type column, you can specify the binary form of the output to either the s/390 format(hexadecimal floating point, or HFP), or the IEEE format(binary floating point, or BFP). |
Correct me, if iam wrong.
Sushanth |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi sushanth bobby
I assume that, the column with datatype DECIMAL(7,0) is representing X'40404040' and it is internally using 4 bytes. It is decimal not REAL or FLOAT. And X'40' represent a blank space. That is why I came to that conclusion.
Regards
Raghu |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I put a validation in my COBOL program that checked the NULL Indicator value as X'FF'. Is such kind of comparison allowed in COBOL? |
There's a link to manuals at the top of the page. Look up HIGH-VALUES in the COBOL Language Reference . |
|
Back to top |
|
|
|