MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Submitting REXX in Batch

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Prasam
Beginner


Joined: 20 May 2004
Posts: 26
Topics: 7
Location: Illinois,USA

PostPosted: Fri May 28, 2004 1:48 am    Post subject: Submitting REXX in Batch Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 28, 2004 4:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Prasam
Beginner


Joined: 20 May 2004
Posts: 26
Topics: 7
Location: Illinois,USA

PostPosted: Fri May 28, 2004 6:50 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 28, 2004 8:40 am    Post subject: Reply with quote

Prasam,

Look at the examples in the following link. The examples can be found from page 39.

http://ew.share.org/callpapers/attach/Washington_DC/s8312.pdf

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri May 28, 2004 1:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Prasam
Beginner


Joined: 20 May 2004
Posts: 26
Topics: 7
Location: Illinois,USA

PostPosted: Sun May 30, 2004 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Tue Jun 01, 2004 12:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Prasam
Beginner


Joined: 20 May 2004
Posts: 26
Topics: 7
Location: Illinois,USA

PostPosted: Tue Jun 01, 2004 2:51 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Jun 01, 2004 3:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Wed Jun 02, 2004 9:15 pm    Post subject: Reply with quote

...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
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Wed Jun 02, 2004 9:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Wed Jun 02, 2004 9:27 pm    Post subject: Reply with quote

Sorry folks. Ignore that last response. I posted this in the WRONG forum.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group