View previous topic :: View next topic |
Author |
Message |
Prasam Beginner

Joined: 20 May 2004 Posts: 26 Topics: 7 Location: Illinois,USA
|
Posted: Fri May 28, 2004 1:48 am Post subject: Submitting REXX in Batch |
|
|
Hi All,
I wrote one rexx routine which will access DB2 tables and give me the output in one dataset according.But running it daily will take about 30 minutes.As a result my session is getting wasted for this routine for 30 minutes.So i thought of running a JCL which will take REXX routine as input with IRXJCL as PGM.
Here is the JCL
Code: |
//MA1 JOB (S-ABCDEF-SGCX,,,100),
// 'RBATCH %MAN1%',
// CLASS=B,
// MSGCLASS=X,
// REGION=5M,
// NOTIFY=MAN1
//IRXPRAS EXEC PGM=IRXJCL,PARM='DEMPRNT'
//SYSEXEC DD DISP=SHR,DSN=STSO.MA.N200EXEC
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
|
here DEMPRNT is my rexx routine.
But after submitting the above JCL,REXX routine is not looging into DB2
at all.One of my colleagues is saying that you can access DB2 thru REXX
while you submit it in batch.
Please could any one suggest any solution for this?
Thanks,
Prasanth |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri May 28, 2004 4:59 am Post subject: |
|
|
You need to execuete the rexx routine with IKJEFT01. Try the following JCL
Code: |
//STEP0100 EXEC PGM=IKJEFT01,PARM='DEMPRINT'
//STEPLIB DD DISP=SHR,DSN=TEST.LM
// DD DISP=SHR,DSN=PROD.LM
// DD DISP=SHR,DSN=DBNT.DSNLOAD
// DD DISP=SHR,DSN=DBNT.DSNEXIT
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DSN=PDS.REXX.EXEC,
// DISP=SHR
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Last edited by kolusu on Fri May 28, 2004 5:27 am; edited 1 time in total |
|
Back to top |
|
 |
Prasam Beginner

Joined: 20 May 2004 Posts: 26 Topics: 7 Location: Illinois,USA
|
Posted: Fri May 28, 2004 6:50 am Post subject: |
|
|
Thanks very much for your Reply Kolusu,
But still iam not able to logon to DB2 thru my REXX routine.Iam getting RC =8
when iam trying to logon to DB2 thru REXX by giving 'ADDRESS DB2 "LOGON" DB2U'
Please could you help...
Thanks,
Prasanth. _________________ The struggle alone pleases us, not the victory. -Pascal,Blaise- 1623-1662, French Scientist |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Fri May 28, 2004 1:25 pm Post subject: |
|
|
Just one question, Kolusu. Why the STEPLIB in the code you posted? Isn't it an overkill? _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
Prasam Beginner

Joined: 20 May 2004 Posts: 26 Topics: 7 Location: Illinois,USA
|
Posted: Sun May 30, 2004 11:44 pm Post subject: |
|
|
Thanks Kolusu,
I have gone thru the link you suggested.
But my problem is iam able to execute my REXX routine ok by typing TSO DEMPRINT.But problem is while i submit my REXX thru batch iam not getting the
desired result..(Logging to DB2 is failing here.).
Thanks,
Prasanth. _________________ The struggle alone pleases us, not the victory. -Pascal,Blaise- 1623-1662, French Scientist |
|
Back to top |
|
 |
Maton_Man Beginner

Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Tue Jun 01, 2004 12:48 am Post subject: |
|
|
It would really help us if you were to provide some error logs or screen prints. As it stands we would have to be psychic to work out what your problem is. _________________ My opinions are exactly that. |
|
Back to top |
|
 |
Prasam Beginner

Joined: 20 May 2004 Posts: 26 Topics: 7 Location: Illinois,USA
|
Posted: Tue Jun 01, 2004 2:51 am Post subject: |
|
|
First of all,Sorry for not giving you the clearer picture of my doubt.
[code:1:904ca67c31]
Here is my code...
/*******************************REXX*******************************/
/*****************************DEMPRINT****************************/
Trace On
Main_Control:
Call Initproc
Call Process_A
Call PrepareSols
Call Closeproc
Return
Trace Off
Initproc:
SUBCOM 'DB2' /* Check environment isn't */
/* already set up */
IF RC > 0 THEN DO
ADDRESS TSO "REXXCOMM ADD DB2 REXXDB2 REXX-DB2 I-FACE'"
END
/*------------------------ CONNECT TO DB2 ----------------------------*/
SSID = "DB2P" /* setup DB2 Subsystem */
ADDRESS DB2 "LOGON" SSID /* Connect to subsystem */
IF RC = 0 THEN
NOP
ELSE DO
SAY "Unable to logon..."
EXIT
END
Process_A:
OUTDS = "PDS.OUTDS.OUPUT"
OUTDS = "'" || OUTDS || "'"
"ALLOC DSN("OUTDS") DDN(OUTPT) SHR REUSE"
If RC _________________ The struggle alone pleases us, not the victory. -Pascal,Blaise- 1623-1662, French Scientist |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Jun 01, 2004 3:47 pm Post subject: |
|
|
I would have you examine the STEPLIB differences between your TSO proc and your batch TSO JCL. Maybe you're missing some DB2 libraries?
Regards,
Bill Dennis |
|
Back to top |
|
 |
Maton_Man Beginner

Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed Jun 02, 2004 9:15 pm Post subject: |
|
|
...after you've checked Bill's suggestion perhaps you could tell me what version of DB2 you have? _________________ My opinions are exactly that. |
|
Back to top |
|
 |
Maton_Man Beginner

Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed Jun 02, 2004 9:26 pm Post subject: |
|
|
I don't really do this sort of stuff much but the manual (surprise, surprise) appears to give the answer. Under 6.2.6.8 Calling a stored procedure from a REXX Procedure in the DB2 Application Programming Guide there is the following information:
Quote: |
The format of the parameters that you pass in the CALL statement in a REXX
procedure must be compatible with the data types of the parameters in the
CREATE PROCEDURE statement. Table 67 lists each SQL data type that you can
specify for the parameters in the CREATE PROCEDURE statement and the
corresponding format for a REXX parameter that represents that data type.
|
<snip>
Quote: |
CHARACTER(n) A string of length n, enclosed in single
VARCHAR(n) quotation marks.
VARCHAR(n) FOR BIT ATA
|
You will even find a rexx program example. I suggest you pad your parm value with spaces. _________________ My opinions are exactly that. |
|
Back to top |
|
 |
Maton_Man Beginner

Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed Jun 02, 2004 9:27 pm Post subject: |
|
|
Sorry folks. Ignore that last response. I posted this in the WRONG forum. _________________ My opinions are exactly that. |
|
Back to top |
|
 |
|
|