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
 

 

Downloading from table into sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Downloading from table into sequential file
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    Post subject:
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    Post subject: Re: Downloading from table
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    Post subject:
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    Post subject: Re: Downloading from table
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    Post subject:
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    Post subject: Re: Downloading from table into sequential file
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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