View previous topic :: View next topic
|
Author |
Message |
jayanta_nit
New User
Joined: 13 Apr 2006 Posts: 22 Location: hyderabad
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
swayam
New User
Joined: 30 Apr 2006 Posts: 1
|
|
|
|
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 |
|
|
|