Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us