View previous topic :: View next topic |
Author |
Message |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Wed Nov 05, 2008 5:47 am Post subject: Need help in preparing a REXX tool |
|
|
Hi,
I need your help in preparing a tool for below description. Just to let you know I have started learing REXX to prepare this tool.
Scenario :
In a reports job(contains almost 20 reports) the following information from reports mentioned below needs to be pickedup and sent in a mail.
from SPOOLA - this report may or maynot be generated
5/11/08 ACCEPTABLE CONDITION CODES 08309 PAGE 1
JOBNAME CC ABEND MTIME
ACA5I000 0004 20:41:57
ACUA9100 0004 20:57:29
ACUEB90# 0004 02:25:53
from SYSPRINT(ddname) EZDB2(stepname) some where at the end get below data
**
** START OF BEM THREAD JOBS THAT NEED CHECKING
**
ACUZR3G0 J 6331 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer R1102
ACUZR3G0 J 6331 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer R1102
ACUZR4G0 J 6336 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer C002
ACUZR4G0 J 6336 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer C002
ACUZR5G0 J 6334 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer 9S10
ACUZR5G0 J 6334 ** PA230B3 -0002E-E:W6A0 does not exist for Reviewer 9S10
**
** END OF BEM THREAD JOBS THAT NEED CHECKING
from SPOOLC somewhere at the end I have to collect only the time from a line like below
SCHEDULE FINISHED AT 08310 01:18:23
And all this information is to be sent in a mail.
Now can some one tell me if this(extracting info from spool and sending mail) can be achived through REXX ? If yes please help in doing this.
Thank You,
Suresh. |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Nov 05, 2008 8:06 am Post subject: |
|
|
A couple of comments first. Your approach to this project is wrong. Before you start writing code in whatever language you choose, you need to define HOW the process is going to work and what resources are needed for it to work. You haven't provided any details as to HOW you intend to accomplish this process.
TSO/E REXX doesn't have any functions or constructs for accessing the spool areas. Another process will be required.
There are two processes that I know of for accessing spool data.
One is to use the TSO/E OUTPUT command. Use of this command requires that you know the job name and job number for the data you wish to retrieve. Also, it's use is normally restricted to accessing data from YOUR jobs only.
The second is to use a spool interface tool, such as SDSF, IOF, or CA-Sysview. I don't know, of course, which tool your site uses. I do know that SDSF and CA-Sysview offer a batch interface, and that SDSF and IOF offer a REXX interface.
I think that once you've picked the tool and coded the interface to access the information you need, the REXX coding part will be relatively straight-forward. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Nov 05, 2008 12:17 pm Post subject: |
|
|
You could get the reports written to dataset and then process those datasets then you would not need the spool routines. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Thu Nov 06, 2008 12:26 am Post subject: |
|
|
Hi SuperK and Nic Clouston,
Thanks for your suggestions. We use SDSF in our project. Also if it is complex to use spool routines, I would prefer to catalog the job using XDC and run the REXX tool to extract data and send mail.
Our main intention is to minimise manual work of checking each report adn send mails. By this we want to reduce the manual errors too.
Thank You.
Suresh. |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Fri Nov 07, 2008 12:24 am Post subject: |
|
|
Hi,
Please let me know the proceedings if I catalog the job.
Thanks,
Suresh. |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Fri Nov 07, 2008 4:33 am Post subject: |
|
|
someone please help at the earliest possible...
Thank You very Much,
Suresh. |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Nov 07, 2008 8:09 am Post subject: |
|
|
Have you searched the forum for any examples of using SDSF in batch to extract data from the spool ? There should be quite a few of them. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Nov 07, 2008 1:33 pm Post subject: |
|
|
We can only provide answers etc in our spare time - for me, that is after my day's work when I get home so please do not push. If it is really urgent then this is not the place to ask, your own shop is.
What do you mean by 'catalog the job'? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Tue Nov 11, 2008 1:35 am Post subject: |
|
|
I didn't ask anyone here to answer me immediately. I just asked to help me at their earliest possible time. I thought no one may be looking at the post, so just to keep it alive I have placed a please reply.
"What do you mean by 'catalog the job'?"
Using XDC option I can write the entire job logs and reports in to a single dataset. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Nov 11, 2008 4:22 pm Post subject: |
|
|
Ah, copy from SDSF to a dataset! If you can, try and copy only the required sysout datasets to a file - easier to analyse what you need to do to get to your actual data. Obviously this can be done online but whether you can do it in one pass in batch I do not know - still, only 2 datasets so only 2 executions - no great overhead. But even easier if you write the data direct to a dataset as it is created instead of SYSOUT - that is only a JCL change to direct SYSRINT to a dataset rather than SYSOUT. You then no longer need to copy the spool to a dataset. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Wed Nov 12, 2008 1:17 am Post subject: |
|
|
Thanks Nic, But there is a problem, I cant change the JCL as the report job is not in my hand. I can only play with reports to send the mail.
Ok, now I am completely rephrasing the question to make it as simple as I can.
I have a dataset, and I wantto extract following pieces of data and send a mail.
All the pieces if codes are encountered some where in the middle of the program. I just providing the guidelines to poin the data.
There will be a lines like this
10/11/08 UNACCEPTABLE JOB FAILURES 08312 PAGE 1
JOBNAME CC ABEND MSG MTIME
ACUTXCT1 0008 00:47:29
ACUTXRN1 0007 00:56:36
I want to extract all these lines. To find these lines the clue is, the title. But the number of jobs is dynamic. So end of the jobs can be found by checking the 13th and 14th bytes as '00', if not then the report ends.
Just let me know how to do this dynamic pointing and retriving of data and sending mail in REX. I will through that code and extract the remaining data. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Nov 12, 2008 2:11 pm Post subject: |
|
|
Use one of the following Rexx functions to see if the report line you are currently processing has one of the keys that you look for - UNACCEPTABLE, 00 etc
INDEX, POS, WORDINDEX, WORDPOS
Use whichever seems best for your requirement. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Nov 12, 2008 4:34 pm Post subject: |
|
|
If you only want to extract then you can also use sort or file-aid |
|
Back to top |
|
 |
suresh_d Beginner

Joined: 20 Sep 2006 Posts: 33 Topics: 9
|
Posted: Thu Nov 13, 2008 6:42 am Post subject: |
|
|
Thanks Nic, I researched ont he keywords given by you.. They are helpful..
Dibakar,
I am trying to create a tool to run on my daily report jobs... so to reduce manual work and I am going for rex, because using rex I can simply run the command on command line and get the results... |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Nov 13, 2008 7:15 am Post subject: |
|
|
you can also submit a job from a command line in the same way |
|
Back to top |
|
 |
|
|