View previous topic :: View next topic
|
Author |
Message |
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi,
I need to download a table into sequential file,but the fields in table are in
comp values ,so when i download into file i cannot view those values
so is there any utility to convert comp values to displayable format while downloading itself?
Thanks
Rups |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi Rups,
If you are using an unload query from table, you can use digit function with columns having integer decimel(cobol comp declaration) datatypes
to convert that to character string and unload this value..
pls correct me if I am wrong... |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi Prajesh,
Thanks for your reply.Can you explain me with an example.
Thanks
megha |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Rups,
If ur unload query is like
select empid, empname from emp_table:
and empid in having a datatype of small int...this will come as a comp field in the unload file..
Instead of that if you can use
select DIGITS(empid), empname from emp_table:
this will give a format that is readable in unload file..I think CHAR fuction can also be used for tha same.. |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi,
In my table I have date field declared as s9(9) comp.
i tried to download using query select digit(date) from emp table,but in the output i am getting the result as 001996091 but i need the output in the form 19960911,i dont want those two leading zeroes.
please help me with this
thanks
rups |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Hi Rups,
I am not sure why it is s9(9) comp. Whats the DB2 datatype for this date field in the table?..usually for Date it is X(10).
Anyway if you are sure that, you want to remove leading zeros in all cases..Function SUBSTR can be used..
SUBSTR(DIGITS(date),3,8) will do that..
Pls correct me if I am wrong..! |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi Prajesh,
The DB2 data type for this field is Integer.
thanks
rups |
|
Back to top |
|
|
|