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
 

 

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: 8117
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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