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

Capture Joblog into PS Using REXX


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

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Dec 01, 2010 2:21 pm
Reply with quote

Hi,

I have coded a rexx program to capture joblog from spool into a PS. Here is the code:

Code:

/* REXX */                                                                       
 STRNG='JESYSMSG'                                                               
 JOBNAME=Substr(FLIST.in,1,8)                                                   
 JOBID=Substr(FLIST.in,10,8)                                                     
                                                                                 
 Say JOBNAME                                                                     
 Say JOBID                                                                       
                                                                                 
ADDRESS TSO                                                                     
X = MSG("OFF")                                                                   
TEMP=USERID()||'.TP.SDSF'                                               
                                                                                 
ADDRESS TSO                                                                     
B=SYSDSN("'"TEMP"'")                                                             
If B = OK Then                                                                   
"DELETE '"||TEMP||"'"                                                           
"ALLOC F(ISFIN) TRACKS SPACE(1) REU"            /* USED BY SDSF     */           
                                                                                 
"ALLOC F(ISFOUT) DA('"TEMP"') NEW",                                             
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"                       
                                                                                 
"ALLOC F(OUTDD) DA("OUTFIL") NEW CATALOG REU ",                                 
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"                       
                                                                                 
QUEUE "SET CONFIRM OFF"                                                         
QUEUE "OWNER *"                                                                 
QUEUE "PREFIX *"                                                                 
QUEUE "DA"                                                                       
QUEUE "ST"                                                                       
QUEUE "SELECT "JOBNAME JOBID                                                     
QUEUE "AFD REFRESH"                                                             
QUEUE "FIND "JOBNAME                                                             
QUEUE "++?"                                                                     
QUEUE "FIND "STRNG                                                               
QUEUE "++S"                                /* BROWSE MSGUSR DATASET */           
QUEUE "PRINT FILE OUTDD "                  /* PRINT TO TEMP DATASET */           
QUEUE "PRINT 1 999999"                                                           
QUEUE "PRINT CLOSE"                                                             
QUEUE "END"                                                                     
QUEUE "EXIT"                                                                     
                                                                                 
"EXECIO" QUEUED()" DISKW ISFIN (FINIS"     /* INPUT TO SDSF BATCH   */           
                                                                                 
"EXECIO * DISKW OUTDD(FINIS"                                                     
                                                                                 
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,255')" /* INVOKE SDSF */         
A = MSG(X)                                                                       
                                                                                 
Exit                                                                             


I am executing this rexx program in BATCH using following jcl,

Code:

//STEP04 EXEC PGM=IKJEFT01,PARM='rexx pgm'
//SYSEXEC  DD  DSN= rexx lib,DISP=SHR
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//OUTDD    DD  DSN=output ps file name,
//             DISP=(NEW,CATLG,DELETE),UNIT=DISK,
//             DCB=(LRECL=133,RECFM=FB,BLKSIZE=0)
//SYSTSIN  DD  DUMMY
//SYSIN    DD  *
P473574G
JOB08484
/*


I am getting EMPTY output file with the following message displayed in SYSTSPRT

Code:

********************************* TOP OF DATA **********************************
P473574G
JOB08484
    54 *-*  ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,255')" /* INVOKE SDSF
       +++ RC(-3) +++
READY
END
******************************** BOTTOM OF DATA ********************************


Could you please let me know where I am doing wrong in my REXX code?

Thanks in advance.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Dec 01, 2010 2:25 pm
Reply with quote

You are using ISPF services without allocating the ISPF libraries via the JCL.

However, I am very impressed that you have posted ALL of the information required to resolve this in your first post.
Well done icon_biggrin.gif

Other posters please take note
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Dec 01, 2010 6:05 pm
Reply with quote

Thanks Expat,

Here onwards I will try to post all the required information for my queries.

I ran the job by allocating all ISPF libraries in JCL but still I got same output as I mentioned in my first post.

Could anyone suggest a solution for my problem? icon_sad.gif icon_sad.gif icon_sad.gif

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

Global Moderator


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

PostPosted: Wed Dec 01, 2010 6:17 pm
Reply with quote

Didn't notice earlier, but you do need to invoke ISPF to be able to use its services. Here's the PARM from an EXEC card I usually use.

Code:
PARM='ISPSTART CMD(%REXX Pgm)'
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Wed Dec 01, 2010 6:58 pm
Reply with quote

Hi Expat,

I ran the job with your suggestion, i got following message

Code:
********************************* TOP OF DATA **********
ISPI003  Following file was not preallocated:
         ISPPROF
READY
END
******************************** BOTTOM OF DATA ********


Then updated my job with ISPPROF DD name then submitted

Now job is waiting for the dataset which I specified in ISPPROF dd name.

Any suggestions.

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

Global Moderator


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

PostPosted: Wed Dec 01, 2010 7:16 pm
Reply with quote

I usually use this
Code:
//PROFLIST DD DSN=&&TEMPPROF,DISP=(,PASS,DELETE),   
//            SPACE=(TRK,(45,45,44)),               
//            RECFM=FB,LRECL=80                     
//ISPTLIB  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
   ....... other concats
//ISPTABL  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
   ....... other concats
//ISPPROF  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 01, 2010 7:22 pm
Reply with quote

but... wanting to use the settings in the online profile

my ispf batch procedure is a two step process
1) allocate a temporary PROFILE and copy into it the content of the GOOD profile
2) use the aforesaidtemporaryprofile in the ISPF step
Back to top
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Mon Dec 06, 2010 10:56 am
Reply with quote

Hi Expat,

I have modified the job as you suggested and ran the job but I got same error.

Hi Enrico,

I didn't understand what your suggested.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 06, 2010 4:29 pm
Reply with quote

I don't speak REXX much, however, regarding "Capture Joblog into PS Using REXX" - you may have a look at this redbook: www.redbooks.ibm.com/abstracts/sg247419.html or this presentation: publib.boulder.ibm.com/infocenter/ieduasst/stgv1r0/index.jsp?topic=/com.ibm.iea.zos/zos/1.9/Simplification/zOSV1R9_Simplification_SDSFREXX/player.html, both discussing "Implementing REXX Support in SDSF".
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 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
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top