Retriveing massage from submited job in CLP

15 pts.
Tags:
CL/400
CLP
I have CLP and a cobol program. CL program calls the cobol program in Batch mode by doing SBMJOB. The cobol program processing 1000 records from a database file. If it founds errorneous record in the time of processing, then it stops processing with a system generated error massage and control go backs to CL program. My requirement is to trap this errorneous record and also the system generated error massage and make a report with this information and resume the processing of records from very next of the errorneous record that was traped. Please help. My mail Id is mithunpaul123@gmail.com.

 



Software/Hardware used:
AS/400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check out the MONMSG command. Since you didn’t mention the error you are getting, I’m not sure how to tell you to proceed from there.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Please clarify what you mean by "calls the cobol program in Batch mode", "it stops processing with a system generated error massage" and "control go backs to CL program". If you used SBMJOB to run the COBOL program, then control never left your CL program. Therefore, control can't "go back" to your CL program. Control never leaves your CL program. The execution of the COBOL program is totally unrelated to your remaining CL instructions. The SBMJOB executes and that causes a request to call the COBOL program to be placed on a job queue. The COBOL might run practically immediately, it might wait on the queue for seconds, or minutes or forever. Regardless of whether or not the COBOL runs and whether not the COBOL succeeds, your CL doesn't wait. Control has never left. The next instructions in your CL are already running and probably have completed long before the COBOL will have a chance to start. The CL instructions that follow the SBMJOB have no relationship to the submitted job at all. So, please review your CL and rephrase your question. If you want your CL to respond to errors in the COBOL program, you can't use SBMJOB. Your CL will need to call the COBOL directly. (There are ways around that, but you seem to need a lot more experience before attempting more complex operations.) Tom
    125,585 pointsBadges:
    report
  • Rlsantucijr
    And what you are describing is simple data verification - which can be done within the COBOL program. You read the record, verify its data, and based on what your find either process it or write it to an error report and reject it. No need for system messages - or leaving the COBOL program. What you describe is way too complicated for the results you desire.
    445 pointsBadges:
    report
  • TomLiotta
    Note that a MONMSG in the CL will have no connection to any error messages that might be signaled in a submitted job. A MONMSG can follow the SBMJOB command and react to errors in the SBMJOB command itself, but those errors will be totally unrelated to the COBOL instructions. Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    Its been a long time since I programmed in COBOL but I believe the same file handling features are available that are in RPG. Based on that assumption, can you add a file control data structure to your COBOL program - this will give you lots of good info about the file you are inspecting. It should also return the record number from the file in question. You could pass that number back to your CL along with the error number, which is also available in the finl control data structure. Then your CL program could take action such as displaying a message with the record number and error number.
    6,640 pointsBadges:
    report
  • TomLiotta
    can you add a file control data structure to your COBOL program... About the only related element for COBOL is FILE-STATUS which is generally a two-character field. (I think it can be up to 6 bytes for some file types.) AFAIK, there's nothing in COBOL like the RPG INFDS. Each language is free to make available whatever that group chooses. I'd guess that the COBOL group is hampered by (1) having to adhere to COBOL standards while (2) serving 15-20% or less of the number of RPG developers. Tom
    125,585 pointsBadges:
    report
  • Mithunpaul
    Tom, I have use defferent thead to submit the job. so, after geting a decimal data error in CBL, its comes back to CLP. Thanks, Mithun
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following