COBOL program to send an automatic Email when job abends...

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
mkk157
Member
Posts: 37
Joined: Wed Feb 07, 2007 2:00 pm
Location: Hyderabad

COBOL program to send an automatic Email when job abends...

Post by mkk157 » Wed Feb 20, 2008 11:07 am

Dear Experts,

My requirement is to send an automatic email to support services by using a new program, when an abend occurs in an existing COBOL-DB2 program.

To be in detailed:

I have a table ABC_LOCATION with the fields location_id, capacity, locaton_name. All are CHAR(3) And the table contains 12 rows as of now.

In my COBOL-DB2 program, I am retrieving the corresponding location_id and capacity depends on location_name coming from a file which is producing by Up-stream system.

There is another table XYZ_LOCATION which is the base table contains many fields includes location_id and locaton_name.

When ever a new location details are added into the table XYZ_location in the upstream system then my program will give an SQLCODE +100 because there is no row correspond to that new location in the table ABC_LOCATION

OfCourse, they need to do the impact analasys and to inform our team to do necessary amendments in our relative tables.

In the worst case scenario, To avoid the abending of the batch job which impacts all other down-stream batches, we are looking for a solution to write a program to send an automatic mail to support services and inform them to insert a new row into the table ABC_LOCATION and then rerun the job again.

Please suggest me the way to do this. I couldn't get any sample program in our system.
Kumar
If u can dream it, U can do it.

rajivvikaas
Member
Posts: 3
Joined: Tue Dec 18, 2007 12:38 pm

check this program

Post by rajivvikaas » Thu Feb 21, 2008 11:30 am

//TSOHVIJ7 JOB (12345),'JCL',CLASS=E, 00001000
// MSGCLASS=X,NOTIFY=&SYSUID, 00002000
// MSGLEVEL=(1,1) 00003000
/*ROUTE PRINT LOCAL 00004000
//* 00005000
//STEP EXEC SAS 00010000
//SYSIN DD * 00040000
DATA; 00050000
FILENAME MY_FILE EMAIL 00060000
TO="HVIJAYAKUMAR@INAUTIX.COM" 00070000
FROM="HVIJAYAKUMAR@INAUTIX.COM" 00080000
SUBJECT="MAIL CODE" 00080100
ATTACH=("TSOHVIJ.SAS(MAIL1)" 00081000
NAME="MAIL CODE" 00081100
EXTENSION='TXT' 00082000
CONTENT_TYPE="TEXT/PLAIN"); 00083000
DATA _NULL_; 00100000
FILE MY_FILE; 00110000
PUT 'DESCRIPTION OF THE MAIL'; 00120000
RUN; 00130000
QUIT; 00140000
/* 00150000

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others