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

JCL to write the log on to a PDS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Fri Oct 07, 2022 1:40 pm
Reply with quote

Hi Guy,
I have a requirement where i need to run a certain JCL
and then load the log of that JCL into a table.

Actually i'm interested in the log of just one particular step.
Is they any way i can write the log of that step into a file
which i can then load into the table.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Oct 07, 2022 3:08 pm
Reply with quote

Samples tell more than words.
Back to top
View user's profile Send private message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Fri Oct 07, 2022 3:53 pm
Reply with quote

I have a JCL which i run and then go to SDSF to check he log.
What im expecting to do is to specify the log output file in the JCL itself so once the JCL runs the log is written in the dataset i've specified in the JCL itself.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Oct 07, 2022 5:07 pm
Reply with quote

Now have a closer look at your request. You have a finished job you presently check in SDSF, while on the other hand, you wish to write the result of something not fully finished. Possibly you can implement a two step solution using SDSF XDC to get what you aim for.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Fri Oct 07, 2022 5:31 pm
Reply with quote

If you know the log output ddname, then you can amend the JCL to write this to a dataset.... You can add a step to load that dataset into the table.

Garry.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 730
Location: Denmark

PostPosted: Fri Oct 07, 2022 6:09 pm
Reply with quote

This sample lists files from the active job. The REXX step should be the last step of the job. Note, non-standard proc RXINSTREAM just allows in-stream REXX pgms.
Code:
//*                                                                   
//* browse active job                                                 
//*                                                                   
//A       EXEC PGM=IEBGENER                                           
//SYSPRINT DD SYSOUT=*                                               
//SYSIN    DD DUMMY                                                   
//SYSUT1   DD *                                                       
 Kilroy                                                               
  was                                                                 
   here                                                               
//SYSUT2   DD SYSOUT=*                                               
//*                                                                   
//B       EXEC RXINSTRM                                               
//REXX     DD *                 */                                   
                                                                     
 call syscalls 'ON'                                                   
 address syscall 'sleep 5'                                           
                                                                     
 /* Locate self    */                                                 
 isfprefix=mvsvar('symdef','jobname')   /* jobname (me)  */           
 file='ALL'                             /* ddname or ALL */           
                                                                     
 say 'Looking for active job' isfprefix                               
 rc=isfcalls('ON')                                                   
 Address SDSF                                                         
 "ISFEXEC ST"                                                         
 if rc<>0 then call SdsfErr 'ST'                                     
 ap=0                                                                 
 do i=1 to jobid.0                                                   
   if queue.i='EXECUTION' then ap=i                                   
 end                                                                 
 if ap=0 then exit xmsg('Job not found',8)                           
                                                                     
 /* List ddname(s) */                                                 
 "ISFACT ST TOKEN('"TOKEN.ap"') PARM(NP SA)"                         
 if rc<>0 then call SdsfErr 'ST NP SA'                               
 do jx=1 to isfddname.0                                               
   if isfddname.jx=file | file='ALL' then do                         
     say ''                                                           
     say 'File...' isfddname.jx '(dsn='isfdsname.jx')'               
     address tso "EXECIO * DISKR" isfddname.jx "(STEM line. FINIS)"   
     if rc<>0 then exit xmsg('read rc' rc,8)                         
     say 'Lines read:' line.0                                         
     say ''                                                           
     do kx = 1 to line.0                                             
       Say line.kx                                                   
     end                                                             
   end                                                               
 end                                                                 
                                                                     
 exit xmsg('Ok')                                                     
                                                                     
SdsfErr:                                                     
 say arg(1)':' isfmsg                                       
 say isfdisplay                                             
 do  i=1  to  isfmsg2.0                                     
   say isfmsg2.i                                             
 end                                                         
 exit 12                                                     
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2133
Location: USA

PostPosted: Fri Oct 07, 2022 8:02 pm
Reply with quote

The same story again: neither JCL, nor VSAM!

The TS is here since 2009, or earlier. Still no understanding - what JCL is, and how to use it...
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Fri Oct 07, 2022 8:50 pm
Reply with quote

sergeyken wrote:
The same story again: neither JCL, nor VSAM!

The TS is here since 2009, or earlier. Still no understanding - what JCL is, and how to use it...


If the solution I suggested above meets requirements, then it is JCL . .

Garry.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Fri Oct 07, 2022 11:07 pm
Reply with quote

ibmmainframes.com/about11151.html
Also try invoking SDSF in batch , PGM=SDSF.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2133
Location: USA

PostPosted: Sat Oct 08, 2022 6:25 pm
Reply with quote

Garry Carroll wrote:

If the solution I suggested above meets requirements, then it is JCL . .

That is REXX+ISPF+ISPEXEC. Nothing to do with JCL.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Mon Oct 10, 2022 12:26 pm
Reply with quote

sergeyken wrote:
Garry Carroll wrote:

If the solution I suggested above meets requirements, then it is JCL . .

That is REXX+ISPF+ISPEXEC. Nothing to do with JCL.


That was not my suggestion, that was in the panel by Willy Jensen which is after my suggestion.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top