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
 

 

REXX-DB2 utility: not able to run using BATCH JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Wed Mar 21, 2007 12:17 pm    Post subject: REXX-DB2 utility: not able to run using BATCH JCL
Reply with quote

hi ,
i developed a REXX and DB2 utitlity .
i am able to run this utility in online but not able to run using BATCH JCL..
Can anybody help on this...
i am getting -311 ERROR CODE ..while preparing the CURSOR.....
this error i am getting only when i submitted this program in BATCH.....
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 21, 2007 1:37 pm    Post subject:
Reply with quote

Have you allocated all of the libraries in your batch job, by that I mean all of those allocated to your TSO session.

TSO ISRDDN might help you find them.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Wed Mar 21, 2007 2:00 pm    Post subject:
Reply with quote

yes i allocated all the libraries in batch job....
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Mar 22, 2007 1:35 am    Post subject:
Reply with quote

Try to enlarge the NUMERIC DIGITS setting.

O.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Thu Mar 22, 2007 11:26 am    Post subject:
Reply with quote

hi ofter i did the same....please see my code below...i am getting error at cursor prepare....the same error i am not at getting while runining the program in online....

NUMERIC DIGITS(18)
'SUBCOM DSNREXX'
IF RC\=0 THEN
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX
ADDRESS DSNREXX "CONNECT DB2T"
INSQLDA.SQLD = 1
INSQLDA.1.SQLTYPE=496
INSQLDA.1.SQLLEN =18
INSQLDA.1.SQLDATA=889378
INSQLDA.1.SQLIND =0
SQLSTMT=,
"SELECT * FROM F6435DBS.ML_CNSM_XREF",
"WHERE CNSM_ID=? ",
"WITH UR"
'EXECSQL DECLARE C1 CURSOR FOR S1'
IF SQLCODE < 0 THEN CALL SQLCA
'EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT'
IF SQLCODE < 0 THEN CALL SQLCA
'EXECSQL OPEN C1 USING DESCRIPTOR :INSQLDA'
IF SQLCODE < 0 THEN CALL SQLCA
DROP UNIQUE.
BB=1
DO UNTIL(SQLCODE > 0)
'EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA'
SELECT
WHEN SQLCODE = 0 THEN DO
LINE=''
DO S = 1 TO OUTSQLDA.SQLD
LINE = LINE OUTSQLDA.S.SQLDATA
END S
UNIQUE.BB=LINE
BB=BB+1
END
WHEN SQLCODE=100 THEN DO
CPINFOUND='N'
END
WHEN SQLCODE < 0 THEN DO
CALL SQLCA
END
OTHERWISE NOP
END /*SELECT*/
END
'EXECSQL CLOSE C1'
ADDRESS DSNREXX "DISCONNECT"
IF SQLCODE < 0 THEN DO
CALL SQLCA
END



error: "0"
'EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT'
"EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT"
RC(-1) +++
IF SQLCODE < 0
"-311"
"0"
"1"

in the table cnsm_id is integer type and not null....
can anybody help on this.....
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Mar 22, 2007 12:30 pm    Post subject:
Reply with quote

I think you have problem with "INSQLDA.1.SQLLEN =18 ". Look here to find the correct length.

O.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Thu Mar 22, 2007 2:50 pm    Post subject:
Reply with quote

HI OFTER,
EVEN AFTER MODIFYNG THE SQLLENGTH ALSO I AM GETTING THE SAME ABEND....SEE MY TRACED OUTPUT..
9 *-* INSQLDA.SQLD = 1
>L> "1"
10 *-* INSQLDA.1.SQLTYPE=496
>L> "496"
11 *-* INSQLDA.1.SQLLEN =4
>L> "4"
12 *-* INSQLDA.1.SQLDATA=CNSM_ID
>V> "889378"
13 *-* INSQLDA.1.SQLIND =0
>L> "0"
14 *-* SQLSTMT=,
"WHERE CNSM_ID=? ",
>L> "SELECT * FROM F6435DBS.ML_CNSM_XREF"
>L> "WHERE CNSM_ID=? "
>O> "SELECT * FROM F6435DBS.ML_CNSM_XREF WHERE CNSM_ID=?
>L> "WITH UR"
>O> "SELECT * FROM F6435DBS.ML_CNSM_XREF WHERE CNSM_ID=?
18 *-* 'EXECSQL DECLARE C1 CURSOR FOR S1'
>L> "EXECSQL DECLARE C1 CURSOR FOR S1"
19 *-* IF SQLCODE < 0
>V> "0"
>L> "0"
>O> "0"
20 *-* 'EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT'
>L> "EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT"
+++ RC(-1) +++
21 *-* IF SQLCODE < 0
>V> "-311"
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Mar 22, 2007 3:14 pm    Post subject:
Reply with quote

Try to display SQLERRMC. This will tell you who is the "problematic" variable.

O.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Fri Mar 23, 2007 11:08 am    Post subject:
Reply with quote

please see error messages that i got for the same....

SQLWARN = , , , , , , , , , ,
74 *-* SAY 'SQLSTATE='SQLSTATE
>L> "SQLSTATE="
>V> "22501"
>O> "SQLSTATE=22501"
SQLSTATE=22501
75 *-* SAY' SQLERRMC' SQLERRMC
>L> " SQLERRMC"
>V> "001 "
>O> " SQLERRMC 001 "
SQLERRMC 001
SQLCODE =-311
55 *-* SAY 'SQLERRM ='SQLERRM
>L> "SQLERRM ="
>L> "SQLERRM"
>O> "SQLERRM =SQLERRM"
SQLERRM =SQLERRM
56 *-* SAY 'SQLERRP ='SQLERRP
>L> "SQLERRP ="
>V> "DSNXECP "
>O> "SQLERRP =DSNXECP "
SQLERRP =DSNXECP
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am


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