View previous topic :: View next topic
|
Author |
Message |
komal
New User
Joined: 09 May 2005 Posts: 17
|
|
|
|
Hi
Can we extract records from DB2 TABLE to a FLAT FILE using JCL?
Using cursors in COBOL we can do this (i mean a simple select statement using some condition placed in a cursor) but instead of coding cobol prog, i want to do this.
If any of U know the solution plz send the JCL code ASAP.
Kiran |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi There !
You can use utility DSNTEP2, often called batch-spufi, to submit
SQL-Selects in a BatchJob.
//S1 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//*
//SYSTSIN DD *
DSN SYSTEM(DB2T)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
PARMS('NOCOUNT/')
//SYSIN DD *
SELECT DISTINCT VE.VE_ID
FROM S308.VE_DARL VE
JOIN S308.GRUNDKONTO GK
ON GK.KONTO_ID = VE.VE_ID
WHERE GK.KONTONR = 608004552
;
//*
Regard's UmeySan |
|
Back to top |
|
|
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
u can also use the utility DSNTIAUL
anyways .. can anyone share the jcl to upload a table from dataset!!!! |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
Back to top |
|
|
|