Hi
I wanted to know that, can we extract DB2 table to a PS. The data should be separated by delimiter? I want to do it in batch. How can I do that, is there any utility available for this?
Please help me out.
Can we extracting DB2 table into a PS with delimiter?
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Can we extracting DB2 table into a PS with delimiter?
Hi Mandira,
Yes, It is possible to extract DB2 table into a PS with delimiter using UNLOAD utility
Check the link
Yes, It is possible to extract DB2 table into a PS with delimiter using UNLOAD utility
Check the link
for Example 9: Unloading data into a delimited file.
zprogrammer
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Can we extracting DB2 table into a PS with delimiter?
One does not extract anything from DB2 - "unload" is a better word here, I believe. Said that, along with what Pandora-Box has suggested, you might also use a JCL like this:
Hope this helps.
Code: Select all
//UL001 EXEC PGM=IKJEFT01,
// DYNAMNBR=20
//*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD SYSOUT=*
//*
//SYSTSIN DD *
DSN SYSTEM(XXXX)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL')
//*
//SYSREC00 DD DSN=...TBL.UNLOAD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,LRECL=80
//SYSIN DD *
SELECT COLUMN1
,CHAR('|'),COLUMN2
,CHAR('|'),COLUMN3
,CHAR('|'),COLUMN4
,CHAR('|'),COLUMN5
FROM TABLE_NAME
WITH UR;
/*
//*
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute