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

run CLIST or REXX program using JCL


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

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Tue Nov 02, 2010 2:03 am
Reply with quote

Hi,

Please provide the code to run CLIST or REXX program using JCL?

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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Tue Nov 02, 2010 2:11 am
Reply with quote

is it so difficult to look at the manuals or search the forums ?

for example with TSO BATCH JCL or REXX BATCH JCL
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Tue Nov 02, 2010 2:24 am
Reply with quote

Sorry, but I didn't get it after search, that's why I posted here.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 02, 2010 3:03 am
Reply with quote

Hello,

What did you use for the forum search keywords?

Try using JCL SUBMIT REXX as the keywords. Click the "Search for all terms".
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 02, 2010 4:14 am
Reply with quote

or go to this website by Doug Nadel
click on Programming and debugging
and then on JCL for batch ISPF
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 02, 2010 3:22 pm
Reply with quote

Or use the freely available manuals from the official IBM website
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Nov 02, 2010 6:59 pm
Reply with quote

2.6.2.2 Running an Exec in the Background

or

2.6.3.2 Using IRXJCL to Run an Exec in MVS Batch

both from the z/OS: TSO/E REXX User's Guide manual.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 12:38 am
Reply with quote

I have to run the CLIST program (present in PRGSD1.CLIST.ACQFIXDT) , which creates the DB2 query, using the JCL
I used the following JCL:
Code:
//PRGSD1A   JOB 'RUN CLIST PROGRAM','PRGSD1',         
//          CLASS=U,MSGCLASS=X,MSGLEVEL=(1,1)         
//*                                                   
//TMP       EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSEXEC   DD   DSN=PRGSD1.CLIST.ACQFIXDT,DISP=SHR   
//SYSTSPRT  DD   DSN=PRGSD1.REQUEST.ACQFIX.SQL,DISP=SHR
//SYSTSIN   DD   *                                     
%TOESF                                                 
/*                                                     
//                                                     


I got the RC=12 and in output dataset I got the following message:

Code:
READY                                                                   
%TOESF                                                                 
Exec member name must not be specified when exec load DD refers to a sequential
data set.                                                               
READY                                                                   
END                                                                     


Please help me on this!!!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Nov 03, 2010 12:58 am
Reply with quote

which output dataset?
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 1:00 am
Reply with quote

I'm using 'PRGSD1.REQUEST.ACQFIX.SQL' as output dataset
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Nov 03, 2010 1:07 am
Reply with quote

I'm pretty sure that a CLIST must reside in a PDS or PDS/E allocated to the SYSPROC DD statement.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 1:45 am
Reply with quote

I changed the above code as follows:
Code:

//PRGSD1A   JOB 'RUN CLIST PROGRAM','PRGSD1',         
//          CLASS=U,MSGCLASS=X,MSGLEVEL=(1,1)         
//*                                                   
//TMP       EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSEXEC   DD   DSN=PRGSD1.CLIST.LIB(ACQFIXDT),DISP=SHR   
//SYSTSPRT  DD   DSN=PRGSD1.REQUEST.ACQFIX.SQL,DISP=SHR
//SYSTSIN   DD   *                                     
%TOESF                                                 
/*                                                     
//   



TOESF is PFX (prefix) in my CLIST program
Now it shows following in output dataset 'PRGSD1.REQUEST.ACQFIX.SQL':
Code:
READY                 
%TOESF                 
COMMAND TOESF NOT FOUND
READY                 
END                   


Please let me know parameters (contents) for the SYSTSIN DD statement (inline control card) in JCL.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 03, 2010 1:49 am
Reply with quote

Hello,

Did you try using SYSPROC as Kevin suggested?

What happens?
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 1:52 am
Reply with quote

OH SORRY for the mistake, I used SYSPROC instead of SYSEXEC only in the above JCL,

it is giving me the same message in output dataset as 'PRGSD1.REQUEST.ACQFIX.SQL':
Code:
READY                 
%TOESF                 
COMMAND TOESF NOT FOUND
READY                 
END 
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2372
Location: Silicon Valley

PostPosted: Wed Nov 03, 2010 1:54 am
Reply with quote

The JCL is more or less correct. As Dick suggests, you may want to change SYSEXEC to SYSPROC.

But based on the message you are getting, I think it is a problem with your exec and not the JCL. I suggest that you provide a trace of your rexx exec.

Also, add PROFILE MSGID to your SYSTSIN file before your %TOESF invocation.

note: CLIST is a different language than REXX. Please be accurate in your questions if you want good answers.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2372
Location: Silicon Valley

PostPosted: Wed Nov 03, 2010 2:01 am
Reply with quote

Sorry, I missed some of the later posts while I was writing my answer.

You should remove the member name from the SYSPROC statement.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 2:02 am
Reply with quote

My CLIST program is as follows:
Code:
PROC 0 TEST DEBUG COMMIT(Y) NBR(1) PFX(TOESF) SYNC(10) +           
       INDSN( PRGSD1.REQUEST.ACQFIX.JOIN            ) +           
       OUTDSN( PRGSD1.REQUEST.ACQFIX.SQL              )           
/*****************************************************************
/* CLIST    :  ACQFIXDT                                          *
/* DESCRIP  :  CREATE SPUFI TO FIX ACQ. RFIL DATE PROBLEM.       *
/* DESCRIP  :  XIT TO RUN                                        *
/*                                                               *
/*****************************************************************
IF &DEBUG = &STR() THEN +                                         
    CONTROL NOMSG NOLIST MAIN NOSYMLIST                           
ELSE +                                                             
    CONTROL MSG LIST MAIN SYMLIST CONLIST                         
  FREE F(INREC)                                                   
  IF &SYSDSN('&INDSN')¬=OK THEN +                                 
    DO                                                                 
      SET ZEDSMSG = &STR(DSN NOT FOUND)                                 
      SET ZEDLMSG = &STR(DSN &INDSN. COULD NOT BE FOUND)               
      ISPEXEC SETMSG MSG(ISRZ001)                                       
      GOTO END1                                                         
    END                                                                 
  ALLOC DA('&INDSN.') FILE(INREC) SHR REU                               
   SET RPARA   = &STR())                                               
   SET RPARA   = &SUBSTR(1:1,&RPARA)                                   
   SET LPARA   = &STR(()                                               
   SET LPARA   = &SUBSTR(1:1,&LPARA)                                   
   SET COUNTER        = 0                                               
   SET BLNKREC        = &STR+                                           
(                                                                      )
   SET &HOLDTBL = &STR()                                               
   SET &RECCNT  =  0                                                   
   SET &BYPASS  = &STR(N)                                               
   SET LRECL    = (80)                                                 
   SET BLKSIZE  = (23440)                                             
   SET RECFM    = (F B)                                               
   SET ADDR    = &ADDRNBR                                             
/*                                                                   */
/*                                                                  */
  OPENFILE INREC                                                       
AGAIN: +                                                               
   WRITE OUTPUT BEING WRITTEN TO '&OUTDSN.'                           
   DEL '&OUTDSN.' SCR PUR                                             
   SET &LRECL=(80)                                                     
   SET &BLKSIZE=(0)                                                   
   SET &RECFM=(F B)                                                   
   ALLOC FILE(OUTREC) DA('&OUTDSN.') REUSE NEW +                       
         UCOUNT(1) +                                                   
         LRECL(&LRECL) BLKSIZE(&BLKSIZE) RECFM(&STR(&RECFM)) +         
         DSORG(PS) SP(100 50) CYL                                     
   OPENFILE OUTREC OUTPUT                       
READIT: +                                       
    SET &DOAGAIN = &STR(N)                       
    ERROR    GOTO DONE                           
    GETFILE INREC                               
    IF &LASTCC > 0 THEN GOTO DONE               
    ERROR OFF                                   
    SET &RECCNT = &RECCNT + 1                   
    SET &DOAGAIN = &STR(Y)                       
    SET &BYPASS = &STR(N)                       
    SET LOCN     = &SUBSTR(001:005,&STR(&INREC))
    SET RXNBR    = &SUBSTR(006:012,&STR(&INREC))
    SET DOS      = &SUBSTR(013:022,&STR(&INREC))
    SET STATUS   = &SUBSTR(023:023,&STR(&INREC))
    SET DTEAUTH  = &SUBSTR(024:033,&STR(&INREC))
    SET CLCRFIL  = &SUBSTR(034:043,&STR(&INREC))
    SET OLDRFIL  = &SUBSTR(044:053,&STR(&INREC))
    SET TBLID    = &SUBSTR(054:059,&STR(&INREC))                       
WRITEIT: +                                                             
    SET COUNTER        = &COUNTER + 1                                   
    SET G = &STR()                                                     
SET OUTREC  = &STR(--STMT OPTION,AFFECTED-ROWS=1,IF-COUNTS-DIFFER=ERROR)
    PUTFILE OUTREC                                                     
    SET OUTREC  = &STR(  UPDATE &TBLID..PHRFL_REFILL_TBL   )           
    PUTFILE OUTREC                                                     
    SET OUTREC  = &STR(  SET   PHRFL_RFIL_DTE = '&CLCRFIL' )           
    PUTFILE OUTREC                                                     
    SET OUTREC  = &STR(       ,PHRFL_LST_OPR_ID = 'ISR13903' )         
    PUTFILE OUTREC                                                     
    SET OUTREC  = &STR(       ,PHRFL_LST_MNT_TSMP = CURRENT TIMESTAMP )
    PUTFILE OUTREC                                                     
    SET OUTREC  = &STR(  WHERE PHRFL_LOCN = ) &LOCN                     
    PUTFILE OUTREC                                         
    SET OUTREC  = &STR(    AND PHRFL_RX_NBR = ) &RXNBR     
    PUTFILE OUTREC                                         
    SET OUTREC  = &STR(    AND PHRFL_DTE_OF_SRVC = '&DOS' )
    PUTFILE OUTREC                                         
    SET OUTREC  = &STR(    AND PHRFL_RFIL_DTE = '&OLDRFIL' )
    PUTFILE OUTREC                                         
    SET OUTREC  = &STR(   ;  )                             
    PUTFILE OUTREC                                         
    GOTO READIT                                             
DONE: +                                                     
  ERROR OFF                                                 
  SET &NBR = &NBR + 1                                       
  SET &COUNTER = 0                                         
  CLOSFILE OUTREC                                           
END1: +                                                     
  CLOSFILE INREC                                           
  FREE F(INREC)
  FREE F(OUTREC)
EXIT                                                         


After adding the PROFILE MSGID it is showing in output file:

Code:
READY                           
PROFILE MSGID                   
READY                           
%TOESF                           
IKJ56500I COMMAND TOESF NOT FOUND
READY                           
END                             
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Nov 03, 2010 2:03 am
Reply with quote

Lose the member name in the JCL. Be sure that there is a member in the library with the same name as the command (TOESF).
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 2:22 am
Reply with quote

Thanks a lot to all of you!!! It worked.

Now the only problem is that it is throwing a return code of 348 for JCL and showing the following message in output dataset
Code:
READY                                               
PROFILE MSGID                                       
READY                                               
%ACQFIXDT                                           
OUTPUT BEING WRITTEN TO 'PRGSD1.REQUEST.ACQFIX.SQL'
READY                                               
END                                                 


'OUTPUT BEING WRITTEN TO 'PRGSD1.REQUEST.ACQFIX.SQL' ' is the same message which gets showed when we directly execute the CLIST program using 'XIT' command.

Now my JCL looks as follows:
Code:
//PRGSD1A   JOB 'RUN CLIST PROGRAM','PRGSD1',               
//          CLASS=U,MSGCLASS=X,MSGLEVEL=(1,1)               
//*                                                         
//TMP       EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K     
//SYSPROC   DD   DSN=PRGSD1.CLIST.LIB,DISP=SHR             
//SYSTSPRT  DD   DSN=PRGSD1.REQUEST.ACQFIX.SYSOUT,DISP=SHR 
//SYSTSIN   DD   *                                         
PROFILE MSGID                                               
%ACQFIXDT                                                   
/*                                                         


Now I want the return code of JCL as 0.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Nov 03, 2010 2:32 am
Reply with quote

Sorry again , The return code is 0 now... a big THANK YOU to all of all you icon_razz.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 782
Location: Pennsylvania

PostPosted: Wed Nov 03, 2010 5:33 pm
Reply with quote

I think your JCL is a little off.

The SYSPROC should be the entire PDS, not a specific member.

Based on the information provided try:


Code:

//PRGSD1A   JOB 'RUN CLIST PROGRAM','PRGSD1',         
//          CLASS=U,MSGCLASS=X,MSGLEVEL=(1,1)         
//*                                                   
//TMP       EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSPROC   DD   DSN=PRGSD1.CLIST.LIB,DISP=SHR   
//SYSTSPRT  DD   DSN=PRGSD1.REQUEST.ACQFIX.SQL,DISP=SHR
//SYSTSIN   DD   *                                     
%ACQFIXDT 'TOESF'                                                 
/*                                                     
//   


I think you are executing ACQFIXDT in the SYSPROC library, and 'TOESF' is an input argment.
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 Access library name in REXX CLIST & REXX 6
No new posts access library name in REXX CLIST & REXX 2
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts COBOL program logic for comparisipn o... COBOL Programming 2
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top