Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

execute SQL in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
View previous topic :: :: View next topic  
Author Message
jayanta_nit

New User


Joined: 13 Apr 2006
Posts: 22
Location: hyderabad

PostPosted: Mon May 01, 2006 9:48 pm    Post subject: execute SQL in JCL
Reply with quote

hi, can anyone tell me how i can execute an SQL statement through JCL directly?mean i will write query in jcl and i want the output of that query.
............jayanta kr. mondal
Hyderabad.
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon May 01, 2006 11:36 pm    Post subject: Re: execute SQL in JCL
Reply with quote

jayanta_nit,

Code:

//UPDATE  EXEC PGM=IKJEFT1B,REGION=4096K             
//STEPLIB  DD  DSN=Your.DB2.Loadlib,DISP=SHR           
//SYSTSPRT DD  SYSOUT=*                             
//SYSPRINT DD  SYSOUT=*                             
//SYSUDUMP DD  SYSOUT=*                             
//SYSTSIN  DD  *                                     
 DSN SYSTEM(????)                                   
 RUN  PROGRAM(DSNTEP2)                               
 END                                                 
/*                                                   
//SYSIN   DD *
  SELECT COUNT(*)
    FROM DB2.YOUR_TABLE
  ;
/*
//


Dave
Back to top
View user's profile Send private message
swayam

New User


Joined: 30 Apr 2006
Posts: 1

PostPosted: Wed May 03, 2006 8:37 pm    Post subject: use Dynamic SQL: EXECUTE IMEDIATE
Reply with quote

WORKING-STORAGE.
01 WS-SQL.
02 WS-LEN PIC S9(4) COMP VALUE +120.
02 WS-SQL-STMT PIC X(120).
PROCEDURE DIVISION.
ACCEPT WS-SQL-STMT.
EXEC SQL
EXECUTE IMMEDIATE :WS-SQL-STMT
END-EXEC
STOP RUN.

JCL coding convention
//GO.SYSIN *
write SQL stmt here
/*
u can also use prepare and exeute for the same.
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 -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts CEXEC not able to execute if no SLINE... boyti ko CLIST & REXX 2 Wed Apr 13, 2016 4:31 pm
No new posts CALL MACRO EXECUTE FORM - Setting the... sudarshan.srivathsav PL/I & Assembler 7 Tue Feb 09, 2016 10:32 pm
No new posts How steps execute in Job in case of a... richiewalia JCL & VSAM 4 Tue Jan 12, 2016 12:34 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us