IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Table Unload


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Apr 24, 2009 4:58 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 24, 2009 5:12 pm
Reply with quote

Are you sure that data for that column in Image copy (IC) was "correct" at the time of IC itself?
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Apr 24, 2009 5:19 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 24, 2009 7:24 pm
Reply with quote

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
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Fri Apr 24, 2009 11:35 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat Apr 25, 2009 12:25 am
Reply with quote

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
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Sat Apr 25, 2009 1:58 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Apr 25, 2009 2:04 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top