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

Problems occured while unloading a DB2 table to a flat file.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lekshmi_ci

New User


Joined: 14 Mar 2007
Posts: 60
Location: Thiruvananthapuram

PostPosted: Mon Mar 26, 2007 10:43 am
Reply with quote

While we unload from a DB2 table, we are not able to download the SMALLINT and DECIMAL type fields . What could be the solution for this.
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Mon Mar 26, 2007 12:40 pm
Reply with quote

Hi all....

While we unload from a DB2 table, we are not able to download the SMALLINT and DECIMAL type fields . What could be the solution for this.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 26, 2007 2:06 pm
Reply with quote

lekshmi_ci wrote:
we are not able to download the SMALLINT and DECIMAL type fields
What do you mean "not able"? Any error messages or errors?
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Mon Mar 26, 2007 5:35 pm
Reply with quote

No error message.......

But the fields of type DECIMAL&SMALLINT is not viewable in the downloaded flat file? instead some dots&special characters in their place........

What does it mean? actually the file contains the data or not?

Please resolve it at the earliest..........

Thanking you,
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Mon Mar 26, 2007 5:52 pm
Reply with quote

I think your SMALLINT and DECIMAL are unloading by default in binary and packed-dec, resp.

Confirm this by viewing your unloaded data with HEX ON.

Try "INTEGER EXTERNAL" and "DECIMAL EXTERNAL" for display mode.
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Tue Mar 27, 2007 9:45 am
Reply with quote

How to try "INTEGER EXTERNAL" and "DECIMAL EXTERNAL" for display mode?Sorry to ask......
Becasuse I dint used it yet........

Then while I tried to put HEX ON......It was showing some Hex characters along with the records.................

Do you have something to suggest?
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Mar 27, 2007 5:44 pm
Reply with quote

INTEGER EXTERNAL and DECIMAL EXTERNAL are options in the UNLOAD statement.

Please show us what your HEX display looks like and what values you expect to see there. You will always see hex chars in hex mode, so that in itself says nothing. Your integer field will be interpreted as pure binary - base2, whereas your decimal field will be interpreted as packed decimal.
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Tue Mar 27, 2007 6:02 pm
Reply with quote

Thank you all..........

I got my problem corrected..........

by sorting the outrec&taking it into another flat file with OUTREC option......
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Mar 27, 2007 6:18 pm
Reply with quote

How did that give you the integer and decimal values that previously had been just "dots&special characters"? Please explain.
Back to top
View user's profile Send private message
Shobana Bhaskar

New User


Joined: 02 Mar 2007
Posts: 35
Location: Pennsylvania, US

PostPosted: Thu Mar 29, 2007 10:57 am
Reply with quote

Try viewing it using FIELAID tool... Like how you view a VSAM file.. In general COMP-3 values are not displayable/visible as valid values. This might be a similar situation. I would suggest to view it like a VSAM file.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2007 10:22 pm
Reply with quote

Hello,

You can use the sort to reformat that data (which wastes machine resources) or you could do as Phrzby Phil suggested and handle the formatting in the unload. If there are 100 rows, it probably doesn't matter. If there are 100 million rows, you are wasting a lot of system resources. . . .
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top