Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
S3 Customization/Development
How to force an abend in a batch program?
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5187
People Online:
Visitors:
218
Members:
0
Total:
218
Online Now:
New Topics
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1348
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
S3 Customization/Development
How to force an abend in a batch program?
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
pbelsky
Veteran Member
Posts: 80
4/7/2011 2:46 PM
Can someone tell me where I can find out how to force an abend (needs recovery state) in a Lawson COBOL batch program? I have tried the error message APIs but they only print a message, do not force the pgm to abend. Lawson's precompiler will not allow me to populate RETURN-CODE or use STOP RUN. Thank you.
Al Miller
Basic Member
Posts: 10
4/7/2011 3:10 PM
pbelsky,
I've never seen an abend API, but I've accomplished the same by purposely performing an 820-STORE-(filename) without performing the required 800-CREATE-(filename) first.
wilcoxmad
Veteran Member
Posts: 87
4/7/2011 4:49 PM
COMPUTE WS-DUMMY = WS-DUMMY / 0.
this will blow up a program.
Roger French
Veteran Member
Posts: 545
4/7/2011 5:43 PM
In my opinion, force abends is an ineffective and negative method for a COBOL program.
Really, you want a COBOL batch program to logically, by it's code, go into Needs Recovery? Doesn't make sense to me.
If you really want a 'stop' within the program, then try looking at GO TO's, meaning GO TO THE END of the program. Or use standard conditional loop logic. If done right the program will end cleanly and OK (not in needs recovery!).
Forced abends will only give you misery.
Sam Simpson
Veteran Member
Posts: 239
4/7/2011 7:20 PM
What is the reason forcing the program into recovery mode? that is not standard programming methodology. Is the program looping or taking so long? Then cancel it from the scheduler. Are you trying to debug it? Try using display statements all over your program. I remember I once have a program that has many STOP RUNs but this program always write coded reasons and checksum informations into a log file which I can always look for reasons why the program stop.
Al Miller
Basic Member
Posts: 10
4/7/2011 7:39 PM
I've coded AP Invoice interfaces for clients that were spec'ed for none of the transactions to be interfaced if any one record failed to "map" to a Lawson Vendor. The job was forced into recovery. Email alerts went out with an error report attachement. The users corrected "mapping" errors with a Lawson form, after which a request was sent to the Help Desk to recover the job. Everything worked seemlessly without any IT assistance.
pbelsky
Veteran Member
Posts: 80
4/7/2011 11:33 PM
Thanks very much for the info, guys! I was hoping there might be an API or something a bit more graceful, but it sounds from your suggestions like I will just have to make the program take a dive.
FYI for those curious as to why a developer would want to force an abend... My pre-Lawson world was a large DB2 shop. We would commonly code rollbacks+abends to keep a bad file from puking all over the database. This also allows you to restart your program in a spot other than the begining, which is a big deal when your files are large and your batch window is tight. Also, when a program is part of a larger job stream, it is common to code an abend in response to an error that will cause a mess in the next program down the line.
Thank you again.
pbelsky
Veteran Member
Posts: 80
4/16/2011 6:40 PM
Hi, just wanted to give you an update on this, in case anyone ever needs to force an abend. We are on Windows, 9.0.1.5 apps and 9.0.1.7 env, not sure if things work differently for others.
What I was trying to do was force an abend if a csv file was empty (to keep a subsequent transfer step from being run). I tried the good suggestions offered here, and believe it or not, they did not work. When I tried the 820-STORE method, Bismark would not let me compile. When I divided by zero, the program RAN CLEAN. I was stunned.
I was going to try to force the program to read an array out of bounds, but I was too lazy to set it up
I also learned that there doesn't seem to be anything that you can do to a csv that will cause your program to abend. I tried reading/closing it without opening it, reading past EOF, program did not care.
What I finally ended up doing was adding a sequential file to the program, and then issuing a READ for it without an OPEN.
Riverboat Sam
New Member
Posts: 3
5/5/2011 8:36 PM
I have tried adding 1 to numeric variable that contains a space (S0C7), Dividing by zero (S0CB), and doing an Open of the same file twice. Job ran clean. What scares the jeepers out of me is the S0C7 continuing to run. No matter how well you vet your data, eventually you're going to get junk. And continuing to run with junk in calculations... hey, what if the result is a few million dollars off, eh? I cannot believe this is allowed to happen. It is totally unacceptable.
pbelsky
Veteran Member
Posts: 80
5/5/2011 9:13 PM
I know, I was totally freaked out!!!
It's not just awesome... It's LAWSOME.
Tim Autry
Basic Member
Posts: 6
8/1/2011 1:00 PM
If you are using MF-COBOL, this is a clean, forced abort called after you have displayed any/all error messages.
Program Working Storage - XXXWS
03 WS-RETURN-VALUE PIC 9(04) COMP-5 VALUE ZEROES.
Program Working Storage - XXXPD
MOVE 16 TO WS-RETURN-VALUE.
CALL "CBL_ABORT_RUN_UNIT" USING WS-RETURN-VALUE.
pbelsky
Veteran Member
Posts: 80
8/2/2011 3:29 PM
WOW Tim! I came to Lawson from a mainframe shop, and you just opened up a whole new world of MF-COBOL for me
I was able to test your solution this morning, and it works perfectly on our system.
If anyone is interested, I found an alphabetical list of all the MF lib routines here:
http://supportline.microf...03/rhcall17.htm#s001
List by function is here:
http://supportline.microf.../nx50ws03/sytocc.htm
You are not authorized to post a reply.