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

SUBMITTING REXX USING JCL


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

New User


Joined: 22 Jun 2010
Posts: 12
Location: Bangalore

PostPosted: Sun Jun 27, 2010 6:41 pm
Reply with quote

HI,

I HAVE WRITTEN A REXX EXEC TO EXTRACT INFO FROM SPOOL.
EXEC IS WORKING FINE, BUT WHEN I TRIED TO SUBMIT IT THROUGH JCL, THERE IS NO OUTPUT..

PLEASE HELP ME OUT! ANYONE??

MY JCL
Code:
 //TSUE2O4C JOB (METP0240),'spulinfo',             
 //     NOTIFY=&SYSUID,MSGLEVEL=1,MSGCLASS=H,       
 //     CLASS=D,REGION=0M,TIME=NOLIMIT             
 //REXX EXEC PGM=IKJEFT01,PARM=SPUL                 
 //SYSTIN DD *                                     
  ISPSTART CMD(%exec1)                             
 /*                                                 
 //SYSEXEC DD DSN=SS5661.NIKHIL.REXX.TOOLS,DISP=SHR
 //TEMPPRT DD DSN=TSUE2O4.SS5661.OP,DISP=MOD       
 //SYSTSPRT DD SYSOUT=*                             
 //SYSTSIN DD DUMMY                                 

MY REXX EXEC
Code:
/* rexx */                                                           
                                                           
address TSO                                                         
/************* OUTPUT FILE LOGIC*******************/                 
"ALLOC f(isfin) tracks space(1) reu" /* used by sdsf */             
"alloc f(isfout) new delete reu " , /* used by sdsf */               
"cylinder space(2,1) lrecl(133) recfm(f,b,a) dsorg(ps)"             
"alloc f(tempprt) da('TSUE2O4.SS5661.OP') MOD"                       
"ALLOC DA('SS5661.G5661.JOB.FINDINGS') F(COPYIN) SHR REUSE"         
/************READING THE INPUT REFERENCE FILE*********************/ 
"EXECIO * DISKR COPYIN (STEM COPYREC.)"                             
DO TP = 1 TO COPYREC.0                                               
TEMPREC = COPYREC.TP                                                 
CALL PROCESS                                                         
END                                                                 
"FREE F(tempprt)"     
 PROCESS:                                                             
 SAY 'JOBID IS ....'TEMPREC                                           
 JOBID = TEMPREC                                                       
 queue "PRE "JOBID                                                     
 queue "st"                                                           
 queue "find " JOBID                                                   
 queue "++s" /* open output of job */                                 
 queue "print file tempprt" /* print to temp dataset */               
 queue "PRINT 1 99"                                                   
 queue "print close"                                                   
 queue "end"                                                           
 queue "exit"                                                         
 "execio" queued()" diskw isfin (finis" /* input to sdsf batch*/       
 address ispexec "select pgm(isfafd) parm('++25,80')"/* invoke sdsf */
 RETURN                                                               
 exit                                                                 

IN SPOOL IT IS PRINTING AS-
Code:
JOBID IS ....Z545612X                                                           
    29 *-*   "execio" queued()" diskw isfin (finis" /* input to sdsf batch*/   
       +++ RC(1) +++                                                           
    30 *-*   address ispexec "select pgm(isfafd) parm('++25,80')"/* invoke sdsf
       +++ RC(-3) +++                                                           
JOBID IS ....Z545612X                                                           
    29 *-* "execio" queued()" diskw isfin (finis" /* input to sdsf batch*/     
       +++ RC(1) +++                                                           
    30 *-* address ispexec "select pgm(isfafd) parm('++25,80')"/* invoke sdsf */
       +++ RC(-3) +++                                                           
READY                                                                           
END
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Jun 27, 2010 7:17 pm
Reply with quote

NIKHIL SHARMA wrote:
HI,

I HAVE WRITTEN A REXX EXEC TO EXTRACT INFO FROM SPOOL.
EXEC IS WORKING FINE, BUT WHEN I TRIED TO SUBMIT IT THROUGH JCL, THERE IS NO OUTPUT..

PLEASE HELP ME OUT! ANYONE??
Please do not write in all caps.
Have you searched?
How about Error reading Spool for a start?
Back to top
View user's profile Send private message
shibub

New User


Joined: 16 Oct 2009
Posts: 13
Location: Bangalore

PostPosted: Sun Jun 27, 2010 9:16 pm
Reply with quote

Rather than executing a rexx code in batch mode to read spool data we can acheive the same by invoking SDSF in batch, with less headache icon_smile.gif .


Code:

//R0318BSJ JOB (123),'SHIBU',REGION=0M,NOTIFY=R0318B
//BSDSF EXEC PGM=SDSF                               
//REPORT   DD DISP=(,CATLG),DSN=R0318B.SDSF.BATCH,   
//   SPACE=(CYL,(1,1)),RECFM=FB,LRECL=133,BLKSIZE=0 
//ISFIN DD *                                         
ST                                                   
PRE R0318B*                                         
FIND R0318BM                                         
++?                                                 
FIND JESJCL                                         
++S                                                 
PRINT FILE REPORT                                   
PRINT 1 9999                                         
PRINT CLOSE                                         
END                                                 
EXIT                                                 
//ISFOUT DD SYSOUT=*                                 
//SYSUDUMP DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSTSPRT DD SYSOUT=*                               


here R0318B is my id, R0318BM is my job name, JESJCL is the step which need in a ds, and REPORT is the allocated file.
Hope this helps

.Shibu
Back to top
View user's profile Send private message
sai.bhagavatula

New User


Joined: 05 Mar 2007
Posts: 10
Location: Sydney, Australia

PostPosted: Mon Jun 28, 2010 5:33 am
Reply with quote

Just to add to Shibu's point, there is excellent way of using REXX for SDSF. Check the links given by enrico at this post:
http://ibmmainframes.com/viewtopic.php?t=49661

http://www.redbooks.ibm.com/abstracts/sg247419.html
Back to top
View user's profile Send private message
NIKHIL SHARMA

New User


Joined: 22 Jun 2010
Posts: 12
Location: Bangalore

PostPosted: Tue Jun 29, 2010 6:04 pm
Reply with quote

Thanks !! I think it will work, but still if we want the info. for various jobs,
then we will have to call this JCL again & again..

I am trying to do the same using "REXX for SDSF" but still for knowledge sake, I want to know why it's not working through JCL as it is working fine without it...

The JCL & SYSTSPRT are already given above.

JESYSMSG:
UHG9007D THRUPUT MANAGER JOB ANALYSIS ON SYSTEM S1UN
UHG9000D JOB INPUT INFO: SYSAFF=ANY SCHENV=******** INPUT CLASS=D
UHG9001D JOB TSUE2O4C ID INFO: SUBMITTOR=TSUE2O4 RACF USID=TSUE2O4
UHG9002I JOB REQUIRES HSM PROCESSING: NO
UHG9201I JOBCLASS=D HAS A CONCURRENT JOB LIMIT BY RACF USERID, WITHIN THIS JOBCL
UHG9006D JOB EXECUTION INFO: SYSAFF=ANY SCHENV=******** JOBCLASS=D
DTM1459I 2010.178 08:56:15 JOB TSUE2O4C REQUEUED TO CLASS=D
ICH70001I TSUE2O4 LAST ACCESS AT 08:56:01 ON SUNDAY, JUNE 27, 2010
IEF236I ALLOC. FOR TSUE2O4C REXX
IEF237I JES2 ALLOCATED TO SYSTIN
IGD103I SMS ALLOCATED TO DDNAME SYSEXEC
IGD103I SMS ALLOCATED TO DDNAME TEMPPRT
IEF237I JES2 ALLOCATED TO SYSTSPRT
IEF237I DMY ALLOCATED TO SYSTSIN
IGD101I SMS ALLOCATED TO DDNAME (ISFIN )
DSN (SYS10178.T085616.RA000.TSUE2O4C.R0109301 )
STORCLAS (SCWORK) MGMTCLAS ( ) DATACLAS (SEQ)
VOL SER NOS= VIO
SMS ALLOCATED TO DDNAME (ISFOUT )
DSN (SYS10178.T085616.RA000.TSUE2O4C.R0109302 )
STORCLAS (SCWORK) MGMTCLAS ( ) DATACLAS (SEQ)
VOL SER NOS= SWK441
SMS ALLOCATED TO DDNAME COPYIN
TSUE2O4.SS5661.OP RETAINED, DDNAME=TEMPPRT
TSUE2O4C REXX - STEP WAS EXECUTED - COND CODE 0000
TSUE2O4.TSUE2O4C.J0077724.D0000101.? SYSIN
SS5661.NIKHIL.REXX.TOOLS RETAINED, DDNAME=SYSEXEC
TSUE2O4.TSUE2O4C.J0077724.D0000102.? SYSOUT
SYS10178.T085616.RA000.TSUE2O4C.R0109301 DELETED, DDNAME=ISFIN
SYS10178.T085616.RA000.TSUE2O4C.R0109302 DELETED, DDNAME=ISFOUT
SS5661.G5661.JOB.FINDINGS RETAINED, DDNAME=COPYIN
STEP/REXX /START 2010178.0856
IEF374I STEP/REXX /STOP 2010178.0856 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
IEF375I JOB/TSUE2O4C/START 2010178.0856
IEF376I JOB/TSUE2O4C/STOP 2010178.0856 CPU 0MIN 00.02SEC SRB 0MIN 00.00S

JESMSGLG:


08.56.15 J0077724 ---- SUNDAY, 27 JUN 2010 ----
08.56.15 J0077724 IRR010I USERID TSUE2O4 IS ASSIGNED TO THIS JOB.
08.56.16 J0077724 ICH70001I TSUE2O4 LAST ACCESS AT 08:56:01 ON SUNDAY, JUNE 27
08.56.16 J0077724 $HASP373 TSUE2O4C STARTED - WLM INIT - SRVCLASS BATTSTDF - S
08.56.16 J0077724 IEF403I TSUE2O4C - STARTED - TIME=08.56.16
08.56.16 J0077724 - --TIMINGS (MINS.)--
08.56.16 J0077724 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
08.56.16 J0077724 -TSUE2O4C REXX 00 31 .00 .00 .00
08.56.16 J0077724 IEF404I TSUE2O4C - ENDED - TIME=08.56.16
08.56.16 J0077724 -TSUE2O4C ENDED. NAME-spulinfo TOTAL CPU TIME=
08.56.16 J0077724 $HASP395 TSUE2O4C ENDED
------ JES2 JOB STATISTICS ------
27 JUN 2010 JOB EXECUTION DATE
11 CARDS READ
78 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
5 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jun 30, 2010 12:19 pm
Reply with quote

For a start - you are invoking ISPF services but have no ISPF libraries allocated.
Back to top
View user's profile Send private message
NIKHIL SHARMA

New User


Joined: 22 Jun 2010
Posts: 12
Location: Bangalore

PostPosted: Thu Jul 01, 2010 12:07 pm
Reply with quote

I am new to REXX. Can you please tell me how to do that??
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jul 01, 2010 12:31 pm
Reply with quote

NIKHIL SHARMA wrote:
I am new to REXX. Can you please tell me how to do that??
I should also assume that you are new to manuals as well.

Courtesy of the forum librarian service icon_rolleyes.gif
Click HERE to read the required manual.
Back to top
View user's profile Send private message
NIKHIL SHARMA

New User


Joined: 22 Jun 2010
Posts: 12
Location: Bangalore

PostPosted: Wed Jul 07, 2010 1:21 pm
Reply with quote

Sorry for the delay..
I have already used that ispf library comand in jcl, please see above..
But still it is not working..
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Jul 07, 2010 7:38 pm
Reply with quote

Quote:

Sorry for the delay..
I have already used that ispf library comand in jcl, please see above..
But still it is not working..

Do not care about the delay....
What command do you mean?
We do nto see your JCL since the first post. Is it still the same?
Still not working is not helpful in the least.

Did you go to the link Expat posted to find sample JCL?
I did and found this....

Code:

//USERAA JOB (AA04,BIN1,000000),'I. M. USERAA',
     // CLASS=L,MSGCLASS=A,NOTIFY=USERAA,MSGLEVEL=(1,1)
     //*-------------------------------------------------------*/
     //*  EXECUTE ISPF COMMAND IN THE BACKGROUND               */
     //*-------------------------------------------------------*/
     //*
     //ISPFBACK EXEC PGM=IKJEFT01,DYNAMNBR=25,REGION=1024K
     //*- - ALLOCATE PROFILE, PANELS, MSGS, PROCS, AND TABLES -*/
     //ISPPROF  DD DSN=USERAA.ISPF.PROFILE,DISP=OLD
     //ISPPLIB  DD DSN=ISP.SISPPENU,DISP=SHR
     //ISPMLIB  DD DSN=ISP.SISPMENU,DISP=SHR
     //ISPSLIB  DD DSN=ISP.SISPSENU,DISP=SHR
     //         DD DSN=ISP.SISPSLIB,DISP=SHR
     //ISPTLIB  DD DSN=USERAA.ISPF.TABLES,DISP=SHR
     //         DD DSN=ISP.SISPTENU,DISP=SHR
     //         DD DSN=ISP.SISPTLIB,DISP=SHR
     //ISPTABL  DD DSN=USERAA.ISPF.TABLES,DISP=SHR
     //*
     //*- - ALLOCATE ISPF LOG DATA SET  - - - - - - - - - - - -*/
     //ISPLOG   DD DSN=USERAA.ISPF.LOG,DISP=SHR
     //*
     //*- - ALLOCATE DIALOG PROGRAM AND TSO COMMAND LIBRARIES -*/
     //ISPLLIB  DD DSN=USERAA.ISPF.LOAD,DISP=SHR
     //SYSEXEC  DD DSN=ISP.SISPEXEC,DISP=SHR
     //SYSPROC  DD DSN=ISP.SISPCLIB,DISP=SHR
     //*
     //*- - ALLOCATE TSO BACKGROUND OUTPUT AND INPUT DS - - - -*/
     //SYSTSPRT DD DSNAME=USERAA.ISPF.ISPFPRNT,DISP=SHR
     //SYSTSIN  DD *
       PROFILE PREFIX(USERAA)         /* ESTABLISH PREFIX      */
       ISPSTART CMD(%TBUPDATE)        /* INVOKE CLIST DIALOG   */
     /*


   Figure 12. MVS batch job
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top