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

Downloading from table into sequential file


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

New User


Joined: 19 Jan 2006
Posts: 17
Location: bangalore

PostPosted: Wed Aug 09, 2006 10:20 am
Reply with quote

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

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 09, 2006 11:46 am
Reply with quote

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

New User


Joined: 19 Jan 2006
Posts: 17
Location: bangalore

PostPosted: Wed Aug 09, 2006 11:59 am
Reply with quote

Hi Prajesh,

Thanks for your reply.Can you explain me with an example.


Thanks
megha
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 09, 2006 12:29 pm
Reply with quote

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

New User


Joined: 19 Jan 2006
Posts: 17
Location: bangalore

PostPosted: Wed Aug 09, 2006 12:47 pm
Reply with quote

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

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 09, 2006 1:47 pm
Reply with quote

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

New User


Joined: 19 Jan 2006
Posts: 17
Location: bangalore

PostPosted: Wed Aug 09, 2006 3:00 pm
Reply with quote

Hi Prajesh,


The DB2 data type for this field is Integer.

thanks
rups
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 Binary File format getting change whi... All Other Mainframe Topics 7
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
Search our Forums:

Back to Top