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:
Zac Shields
Past 24 Hours:
0
Prev. 24 Hours:
1
Overall:
5210
People Online:
Visitors:
330
Members:
0
Total:
330
Online Now:
New Topics
Lawson S3 HR/Payroll/Benefits
Post Tax Benefit Plan Table
11/14/2024 9:16 PM
Hi, totally new to Laswon. I have a repor
Lawson S3 Procurement
ED501 Error: Map 850 not supported by /law/c15vda/lawson/test10/edi/bin/laws_out_91
11/12/2024 3:47 PM
Tried runnning ED501 and getting the atathced erro
Lawson S3 HR/Payroll/Benefits
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
Infor ERP (Syteline)
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:24 PM
Hi, I need help with an error on syteline while us
Dealing with Lawson / Infor
Implementing Lawson v10 with Cerner Surginet, Case Cart Picking, and Quick Adds for the OR
10/29/2024 4:20 PM
Hi Everyone, I am wondering if there is any org
Lawson S3 HR/Payroll/Benefits
Canada Tax Calculation (Federal and Provincial) Issue
10/23/2024 5:00 AM
Initially, we had problem with CPP2 calculation is
Lawson S3 HR/Payroll/Benefits
CA Section 125 401k Plan
10/22/2024 10:13 PM
Does anyone have any recommendations on how to fac
S3 Systems Administration
Running AC120 deleted records from ACMASTER table
10/22/2024 3:40 PM
We recently ran the AC120 as normal and somehow it
Lawson S3 Procurement
RQ13 Approval Info
10/17/2024 2:12 PM
When a Requisition is approved on RQ13, what table
S3 Customization/Development
Read and Write CSV file COBOL
10/9/2024 2:53 PM
Does anyone have a quik example of a program that
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1372
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Integration / Customization
S3 Customization/Development
How to force an abend in a batch program?
Please
login
to post a reply.
11 Replies
0
Subscribed to this topic
17 Subscribed to this forum
Sort:
Oldest First
Most Recent First
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: 549
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
Please
login
to post a reply.