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
 
Passing data to a DB2 query in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Jan 15, 2010 11:18 pm    Post subject: Passing data to a DB2 query in JCL
Reply with quote

I have a requirement that I need to pass data to a query from a file which has only one record. I need to do this in Control card as Proc will not accept if we give in SYSIN card directly.

And I gave my JCL as
Code:

//...
//SYSIN    DD  DSN=TEST.CNTLCARD(MEMBER)               
// DD DISP=SHR,DSN=TEST1.DATA


TEST1.DATA file has data in it...And CNTLCARD has update query
as UPDATE TABLENAME SET FIELD='TEST' WHERE FIELD=

This job is abending with code 12.

Regards
lakshmi
Back to top
View user's profile Send private message

varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Jan 15, 2010 11:42 pm    Post subject:
Reply with quote

Now I am getting the below message as

SQLERROR ON UPDATE COMMAND, PREPARE FUNCTION
RESULT OF SQL STATEMENT:
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL " ". SOME SYMBOLS T
DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 502 0 0 -1 120 0 SQL DIAGNOSTIC INFORMAT
DSNT416I SQLERRD = X'000001F6' X'00000000' X'00000000' X'FFFF
INFORMATION
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 16, 2010 12:35 am    Post subject:
Reply with quote

Hello,

You need to post the full query from the problem output. It may also help if you post all of the jcl.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Sat Jan 16, 2010 8:13 pm    Post subject: Reply to: Passing data to a DB2 query in JCL
Reply with quote

//SORTFILE EXEC PGM=SORT,REGION=4096K
//*
//SORTIN DD DSN=TEST.DATA,DISP=SHR
//*
//SORTOUT DD DSN=TEST1.DATA,
// DISP=(NEW,CATLG,DELETE),SPACE=(100,50),LRECL=9,
// RECFM=FB,BLKSIZE=0
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DSN=TEST.CNTLCARD(TESTUPD),DISP=SHR
//*
//CG805UPD EXEC PGM=IKJEFT01,DYNAMNBR=40
//*
//STEPLIB DD DSN=DBA3.REF.SDSNLOAD,DISP=SHR
//SYSUDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=TEST.CNTLCARD(TESTQUE),DISP=SHR
// DD DISP=SHR,DSN=TEST1.DATA
// DD *
//SYSTSIN DD DSN=TEST.CNTLCARD(TESTDB2),DISP=SHR
//

Above is my JCL......

TESTQUE HAS

UPDATE TABLENAME SET DESC='TEST'
WHERE ID=

and then TESTUPD has

DSN SYSTEM(DB2D)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('DB2D.REF.RUNLIB.LOAD')

Please help me...

Regards
Lakshmi
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Sat Jan 16, 2010 11:28 pm    Post subject:
Reply with quote

Code:
//SYSIN DD DSN=TEST.CNTLCARD(TESTQUE),DISP=SHR
// DD DISP=SHR,DSN=TEST1.DATA
// DD *
//SYSTSIN DD DSN=TEST.CNTLCARD(TESTDB2),DISP=SHR
This code of yours is completely illogical. You start with TEST.CNTLCARD(TESTQUE), then concatenate TEST1.DATA to it, then concatenate instream input with DD * and have nothing there -- so why have it in the JCL at all?
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

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