IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL for external Sub-routine


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Tue Sep 28, 2010 2:24 pm
Reply with quote

Hi All,

I tried executing REXX program using following jcl and it works fine.

Code:
//USERAA JOB (),NOTIFY=&SYSUID
//**********************************************************
//* JCL TO CALL REXX IN BATCH
//**********************************************************
//TSO EXEC PGM=IKJEFT01,PARM='%MAIN'
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSEXEC DD DSN=USERAA.MYPDS.REXX,DISP=SHR
//

My Question is for EXTERNAL SUBROUTINE concept it does not work.When i run MAIN program it says SOC4 , subpogram not linked .

My MAIN program is

/* REXX MAIN PROGRAM*/

SAY "BEFORE subpgm CALLED "
CALL MYSUB
SAY " I AM IN MAIN AGAIN "
EXIT

/* REXX SUBPROGRAM mysub */

SAY 'SUB PROGRAM'
RETURN

help Me.
Back to top
View user's profile Send private message
kacks7

New User


Joined: 22 Sep 2010
Posts: 33
Location: chennai(india)

PostPosted: Tue Sep 28, 2010 2:47 pm
Reply with quote

hi
its executing fine.

my o/p is

BEFORE SUBPGM CALLED
SUB PROGRAM
I AM IN MAIN AGAIN
READY
END

Quote:
//USERAA JOB (),NOTIFY=&SYSUID
//**********************************************************
//* JCL TO CALL REXX IN BATCH
//**********************************************************
//TSO EXEC PGM=IKJEFT01,PARM='%MAIN'
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSEXEC DD DSN=USERAA.MYPDS.REXX,DISP=SHR
//


check with this jcl


Code:

//*                                                               
//* ENTER YOUR JOB CARD HERE                                     
//***************************************************************
//* JCL TO CALL REXX IN BATCH                                     
//***************************************************************
//*                                                               
//* CHANGE TO BE MADE :                                           
//* XXXXXX.YYYYYY - THE LIBRARY WHERE YOUR REXX PGM EXISTS       
//* PPPPPP - THE MEMBER NAME OF YOUR REXX PROGRAM                 
//*                                                               
//***************************************************************
//RXNBATCH   EXEC PGM=IKJEFT01                                   
//SYSEXEC    DD  DSN=XXXXXX.YYYYYY,DISP=SHR                       
//SYSTSPRT   DD  SYSOUT=*                                         
//SYSTSIN    DD  *                                               
 %PPPPPPPP                                                       
/*                                                               
//                                                               
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Tue Sep 28, 2010 2:54 pm
Reply with quote

HI,

Yes i tried that too but no changes. Same error with SOC4 error, subprogram is not linked.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 28, 2010 2:57 pm
Reply with quote

there is nothing wrong with the initial jcl
( apart the odd name MAIN for the rexx )

kacks7 suggestion was lets' say irrelevant

use the trace statement to see what is going on in Your rexx
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Tue Sep 28, 2010 3:12 pm
Reply with quote

HI,

I tried both having in one PDS member , it works correctly , but my question is both MAIN and SUB are in different member of same PDS.

Please reply...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 28, 2010 3:14 pm
Reply with quote

I just checked...
it works also if the main and the subroutine are in different members
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Tue Sep 28, 2010 3:23 pm
Reply with quote

Thanks a lot everybody...

It is working.....Great to have this forum ...all credit goes to you for prompt reply.

Thanks
Back to top
View user's profile Send private message
kacks7

New User


Joined: 22 Sep 2010
Posts: 33
Location: chennai(india)

PostPosted: Tue Sep 28, 2010 3:29 pm
Reply with quote

hi,
may i know wat problem causing the SOC4 error???
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Sep 28, 2010 3:42 pm
Reply with quote

Hmm, odd, it worked just fine for me, with MAIN and MYSUB being two different members in the same PDS.
Back to top
View user's profile Send private message
kacks7

New User


Joined: 22 Sep 2010
Posts: 33
Location: chennai(india)

PostPosted: Tue Sep 28, 2010 3:52 pm
Reply with quote

enrico-sorichetti wrote:

kacks7 suggestion was lets' say irrelevant



i just executed by keeping the main and sub program in diff members of a pds and showed my output what i got. is this irrelavent???
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 28, 2010 5:50 pm
Reply with quote

Looks like You didn' t read my post with the due attention !
and also You posted a suggestion about changing the JCL
the above suggestion was ... useless
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
No new posts ACS exit routine JCL & VSAM 0
No new posts Routine not found... CLIST & REXX 6
No new posts Get name of Subsystem routine is exec... All Other Mainframe Topics 2
This topic is locked: you cannot edit posts or make replies. COBOL-Common routine that contains al... COBOL Programming 4
Search our Forums:

Back to Top