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
 
Can we extract records from DB2 TABLE to a FLAT File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
komal

New User


Joined: 09 May 2005
Posts: 18

PostPosted: Wed Oct 25, 2006 7:01 pm    Post subject: Can we extract records from DB2 TABLE to a FLAT File
Reply with quote

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
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Oct 25, 2006 7:07 pm    Post subject: Re: JCL and DB2
Reply with quote

You can code your SQL queries in the JCL itself to retreive records from a DB2 Table and generate output in a dataset.

Look here for how to code SQLs in JCL...
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Oct 25, 2006 10:34 pm    Post subject: Re: JCL and DB2
Reply with quote

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
View user's profile Send private message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Thu Oct 26, 2006 1:17 pm    Post subject: Re: JCL and DB2
Reply with quote

u can also use the utility DSNTIAUL

anyways .. can anyone share the jcl to upload a table from dataset!!!!
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Oct 26, 2006 1:58 pm    Post subject:
Reply with quote

A LOAD example can be found in the fine manual.

O.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am

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