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
 

 

run CLIST or REXX program using JCL
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: run CLIST or REXX program using JCL
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Nov 02, 2010 2:11 am    Post subject: Reply to: run CLIST or REXX program using JCL
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 02, 2010 3:03 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 02, 2010 3:22 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Nov 02, 2010 6:59 pm    Post subject: Reply to: run CLIST or REXX program using JCL
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Wed Nov 03, 2010 1:07 am    Post subject: Reply to: run CLIST or REXX program using JCL
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    Post subject:
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

Site Director


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

PostPosted: Wed Nov 03, 2010 1:49 am    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Nov 03, 2010 1:54 am    Post subject: Reply to: run CLIST or REXX program using JCL
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

Senior Member


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

PostPosted: Wed Nov 03, 2010 2:01 am    Post subject: Reply to: run CLIST or REXX program using JCL
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Nov 03, 2010 2:03 am    Post subject:
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    Post subject:
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    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


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