Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can we abort a Job directly from COBOL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 10:17 am    Post subject: How can we abort a Job directly from COBOL ?
Reply with quote

hi

i need to know how we can abort a job directly from cobol..
i.e if a field in cobol is non-numeric or if it contains null values then i need to abort the job from further execution.

Title changed from "Direct Abort Codes in Cobo.. Very Urgent.." to "How can we abort a Job directly from COBOL ?" : Priyesh.
Back to top
View user's profile Send private message

cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Tue Dec 12, 2006 10:19 am    Post subject:
Reply with quote

Are you using cics with your cobol
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Dec 12, 2006 10:21 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

Quote:
i need to know how we can abort a job directly from cobol..

You can abort the execution for that perticular program or step; but for further steps you can use COND parameter to check Return Code generated by this program and execute remaining step based on that.
Quote:
i.e if a field in cobol is non-numeric or if it contains null values then i need to abort the job from further execution..

Your shop must be having some abend routine with specific user abend codes to halt execution of the program.
Quote:
please respond immediately.. it is very urgent for me..

If you are really serious above, dont you have some Tech Desk @ Work...
Back to top
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 10:28 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

no i dont sue CICS.. only cobol and JCL..
i need to abort the job in the cobol pgm step itself if there are any non-numeric values in the fields..
Back to top
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 10:45 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

i dont have any tech help desks here.. i need to abort the cobol pgm alone.. rest of the steps i can do as you said.. if i find a field with unacceptable values or undesirable values then i should be able to set a particular code and the job should stop there showing that code..
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Dec 12, 2006 10:57 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

Code:
IF WS-VARIABLE = 'unacceptable values'
    DISPLAY 'I GOT AN UNACCEPTABLE VALUE: 'WS-VARIABLE
    DISPLAY 'PROGRAM IS GOING TO ABEND'
    DIVIDE 9 BY 0.


It'll abend execution of the program and Job, and would show the unacceptable value at the same time.
And you dont need to code any COND parameter in the JCL for further steps, as it would generate a S0C-7, which would cause job to get abended there itself.
Is that what you want to do.
Back to top
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 11:03 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

thanks for the reply priyesh..

but i cant stop the pgm with a SOC7 error.. what is need is this..

i.e if there is a numeric field AMOUNT, and if it gets a non-numeric field as input,
I should be able to set an abort code, say 2232 and abort the job at that step itself..
THE PGM SHOULD ABORT WITH THE CODE..
THEN REQUIREMENT IS TO KNOW WHY THE PGM ABENDED AND FOR THIS WE SET AN ABORT CODE..
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Dec 12, 2006 11:09 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

Quote:
I should be able to set an abort code, say 2232 and abort the job at that step itself..

You can set a Non-Zero Abend code and pass onto JCL from program using RETURN-CODE register value. but then it would not cause program and that step to be abend. In this case, you'll have to code some proc in JCL to abend the execution of the job instead of program.
Code:
MOVE <YOUR RC> TO RETURN-CODE.
Back to top
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 11:13 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

TATS FINE WHEN I ONLY ONE FIELD.. BUT I HAVE MORE THAN ONE FIELDS WHICH CAN HAVE NON NUMERIC VALUES.. SO I CANT SET THE RETURN CODE TO THEM.. IS THERE SOME OPTION LIKE CHECKING THE FIELD AND CALLING A PARA TO ABEND THE PGM DISPLAYING THE ABEND CODES FOR THAT COND?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Dec 12, 2006 11:18 am    Post subject: Re: Direct Abort Codes in Cobo.. Very Urgent..
Reply with quote

Are you sure, your shop doesnt have an inbuilt abend routine... If yes, Check for this...
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Tue Dec 12, 2006 12:24 pm    Post subject: Re: How can we abort a Job directly from COBOL ?
Reply with quote

hi this must solve icon_smile.gif :

declare in Working storage section :

01 ABORT-JOB-CODE PIC S9(4) COMP VALUE +4004.

Note : Value can be greater than 4000 for abending.

In the Procedure division :

MOVE ABORT-JOB-CODE TO RETURN-CODE.

this will abend the CA7.... try out and let us know...

regards,
Sasi Kiran Patha.
Back to top
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 12, 2006 2:24 pm    Post subject: Re: How can we abort a Job directly from COBOL ?
Reply with quote

Hi

thanks for all your replies..

I got the answer for that problem..

In my cobol pgm itself we declare some variables which will give the pgm status..
In that there is a 88 level variable called pgm-abend..
Any values can be set to that variable and the pgm will abend with that value..
priyesh as you said the CEE3ABD abend is available in my pgm itself..
thanks for all the replies..

So prob solved.. icon_lol.gif
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Tue Dec 12, 2006 4:00 pm    Post subject: Re: How can we abort a Job directly from COBOL ?
Reply with quote

COBOL itself comes with a standard abend routine. You can can simply call that routine and pass abend code and reason code as parameters. Just checkout manuals.

The abend code and reason code you are using should be unique and should know everybody in your shop. So you must document it so even operations support folks would know..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us