Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Table Unload

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DB2 Table Unload
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

Senior Member


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

PostPosted: Fri Apr 24, 2009 5:12 pm    Post subject:
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    Post subject:
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: 1013
Location: India

PostPosted: Fri Apr 24, 2009 7:24 pm    Post subject:
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: 186
Location: chennai

PostPosted: Fri Apr 24, 2009 11:35 pm    Post subject: Reply to: DB2 Table Unload
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: 1013
Location: India

PostPosted: Sat Apr 25, 2009 12:25 am    Post subject:
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: 186
Location: chennai

PostPosted: Sat Apr 25, 2009 1:58 am    Post subject: Reply to: DB2 Table Unload
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Sat Apr 25, 2009 2:04 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us