View previous topic :: View next topic
|
Author |
Message |
grvtomar
New User
Joined: 29 Apr 2015 Posts: 7 Location: Sri Lanka
|
|
|
|
Hi,
looking for an alternative option to unload a DB2 table with header(column name)in csv format. I have tried few of the options like
Unloaded a table with utilites like DSNTIAUL, IKJEFT01,DSNUTILB using JCL
1. using below select card...
Select 1 as ID, <"header-names"> from Sysibm.sysdummy
union
Select 2 as Id ,< Column-name> from Usertable
order by ID
2. write column name in different file delimited by ";" and merge it with unload file.
above solution are having some issue with my firm(Guidelines: issues with utilities, performance etc)
any alternate solution for this problem please ?
Thanks
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
grvtomar wrote: |
Unloaded a table with utilites like DSNTIAUL, IKJEFT01, DSNUTILB using JCL |
IKJEFT01 has nothing to do with DB2 or whatever. It can only execute TSO commands in batch environment. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
IKJEFT01 has nothing to do with DB2 or whatever. |
unfortunately that' s the current way of looking at things on most of the forums
( IKJEFT01 as a generic utility to do whatever task at hand -
disregarding the SYSTSIN control statements )
along with considering JCL anything that is not a cobol user program
No flames, nor kind suggestions will make the idtents change their ways
You ( all of us ) will have to live with this |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
To unload the data itself, I think DSNUTILB is the easiest way:
Code: |
UNLOAD DATA FROM TABLE xxx.yyy DELIMITED COLDEL ';' |
If you have SYNCSORT, you can use the DB2 Query Support (if enabled at your site), but then you have to squeeze the values and add separators, making the parameters difficult to read and maintain.
Anyway, both cases will not provide the header line, for which there is no obvious solution. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
enrico-sorichetti wrote: |
Quote: |
IKJEFT01 has nothing to do with DB2 or whatever. |
unfortunately that' s the current way of looking at things on most of the forums
( IKJEFT01 as a generic utility to do whatever task at hand -
disregarding the SYSTSIN control statements )
along with considering JCL anything that is not a cobol user program
No flames, nor kind suggestions will make the idtents change their ways
You ( all of us ) will have to live with this |
Yes...
As well as "IEFBR14 is system utility to delete 'files'..."
Where "14" stands for "the maximum number of files to delete"? |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
My favourite method is QMF's EXPORT DATA command. For example:
Code: |
EXPORT DATA TO 'your .dataset.name.csv' (D=CSV CONFIRM=N |
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
grvtomar wrote: |
above solution are having some issue with my firm(Guidelines: issues with utilities, performance etc)
any alternate solution for this problem please ? |
Only now I notice that we are in the "COBOL Programming" forum.
Is that the alternate solution your company seek ? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
Back to top |
|
|
rajendra05
New User
Joined: 22 Jan 2008 Posts: 4 Location: Hyderabad
|
|
|
|
Post deleted by moderator - Tailgating someone elses topic, resurrecting an old topic. |
|
Back to top |
|
|
|