Posted: Wed Dec 11, 2013 9:42 am Post subject: Write IOF log into flat file
I tried to execute the below code
Code:
"TSICOPY NAME(JOBNAME) SECTION(LOG) ROW(1) TO(REXX)"
"EXIT" /* FOR CLOSING THE IOF PANEL*/
SAY JOBNAME
SAY JOBID
EXIT
but got the below error
Code:
IKJ56500I COMMAND TSICOPY NOT FOUND
I even tried to do it through a batch job using the IKJEFT01 utility but that is also not giving me the complete result.
I went through the entire documentation provided by triangle but that also does not provide the result we want.
I want to read a specific section of the job log and write into a dataset.
I have tried to do it through batch but it is not working.
I have a work arround but that involves some amount of manual effort.
I am looking for some help to build the rexx to read the log and write it into the dataset from IOF.
Any help in building the rexx will be much appreciated! _________________ Thanks & Regards,
SKSS
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Wed Dec 11, 2013 9:54 am Post subject:
So, is the load library that the module resides in allocated to your TSO session? was it included in the steplib for the batch job that you tried? Does it even exist in your installation? _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Wed Dec 11, 2013 11:48 am Post subject:
SKSS,
Please do NOT open multiple topics on the same issue. If you had posted in another topic , please wait for a response. Opening another topic is not going to gain you anything. I have posted a response in your other topic.
I recently needed to capture job output in IOF. I had two needs:
1. Capture DB2 Log information from the DB2 Started Task (DB2 Job Name) into a flat file.
2. Send an email to my team containing a report created by a Batch job.
For number 1 the vendor, Triangle Systems, assisted me by writing a REXX program. For number 2 the vendor pointed me to a REXX program they provide to all their clients. If you have a need that is not satisfied by the following then contact the vendor; they are very helpful.
This is the JCL to execute the following REXX program CAPTJOBL.
This is the REXX program that the vendor provided. It scans all the jobs that match the job name pattern and captures the LOG files (1 SNAP), where 1 is the first DD number listed in the IOF Job Summary screen. I didn't want to capture all job output, just a specific DD, and I definitely didn't want to capture a potential dump and email it.
Code:
/* Rexx - captjobl */
trace 'O'
/*trace 'R' */
/* Determine if IOF is present. If not start IOF and reinvoke */
/* this Rexx exec under IOF. If it is bypass and dive into the */
/* main body of the exec. */
parse source . . cmd . . . . . env . /* Obtain environment info */
if env <> 'IOF' then do /* Is IOF already here? */
parse upper arg parms /* No get parms */
push 'IOF * OPTMENU.%'cmd parms /* Push IOF command onto */
exit /* stack and exit */
end
parse arg jobmask targfile /* Obtain parms */
address IOF /* Set addressing mode */
"IOF * JOBNAME("jobmask")", /* Invoke IOF and get a */
"JOBLIST", /* .. JOB List of the */
"RUNNING" /* .. requested JOBS. */
"LOCK" /* Lock screen to prevent */
/* .. it from changing. */
"TSICOPY NAME(ROWS)", /* Retrieve the number of */
"SECTION(PANEL)", /* .. JOBs that appeared */
"TO(REXX)" /* .. on the JOB List. */
if rows = 0 then /* Process if any found. */
say "No JOBs found mathing" jobmask /* */
else do
say "Processing" rows "JOBs" /* Indicate how many. */
"SD $DDNAME$("targfile")" /* Open the target DDName */
if rc <> 0 then /* If error then dump msg */
say "Error opening target" /* .. and exit */
else do /* Otherwise process list */
do i = 1 to rows /* Now loop through list */
i "TSICOPY NAME(JOBNAME JOBID)", /* Get JOBName/JOBID */
"TO(REXX)"
say ' Processing JOB ', /* Identify JOB being */
LEFT(jobname, 8), /* .. processed. */
LEFT(jobid, 8)
i "SELECT" /* -- Select the JOB */
if rc = 0 then /* -- If "S" works then */
1 "SNAP" /* -- - SNAP Dataset #1 */
else
say ' - Error snapping' rc
"END" /* -- return to JOBList */
end
end
"SNAPCLOS" /* Close the target DDName */
end
"JUMP X" /* Exit from IOF */
exit
This Job will email a job's IOF Job Summary (so you can see the condition codes for each step) and specific DD's, such as SYSUT2 in this case. Each SYSUT2 contains a report that was created in a previous job step. There are multiple SYSUT2 output datasets in the job; all of them will be sent in the email. The REXX program IOFSNDME is in their vendor supplied CLIST PDS.
Job:
Code:
//*----------------------------------------------------------------
//* COPY REPORT TO SYSUT2 SO IT CAN BE EMAILED
//*----------------------------------------------------------------
//JS03OF04 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=my.report.file,DISP=SHR
//SYSUT2 DD SYSOUT=*,LRECL=200
//*
//*----------------------------------------------------------------
//* EMAIL REPORTS (ALL SYSUT2 DD'S)
//*----------------------------------------------------------------
//JS04OF04 EXEC PGM=IKJEFT1B,PARM='IOFSNDME'
//SYSTSPRT DD SYSOUT=*
//SYSPROC DD DISP=SHR,DSN=vendor.IOF.CLIST
//SYSHELP DD DISP=SHR,DSN=vendor.IOF.HELP
//SYSTSIN DD DUMMY
//SYSIN DD *
TO myteamemailaddress@mycompany.COM
SUBJECT DAILY CA-DETECTOR EXCEPTION REPORT: JOB=myjobnam, RC=&RESULT
INCLUDE DDNAME(SYSUT2)
EXCLUDE DDNAME EQ SYSUDUMP
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum