BadJournal class: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 50: | Line 50: | ||
The <var>New</var> constructor generates an instance of a <var>[[BadJournal_class|BadJournal]]</var> exception object, optionally also setting the <var>[[ReasonCode (BadJournal property)|ReasonCode]]</var> property. | The <var>New</var> constructor generates an instance of a <var>[[BadJournal_class|BadJournal]]</var> exception object, optionally also setting the <var>[[ReasonCode (BadJournal property)|ReasonCode]]</var> property. | ||
<h4>Syntax</h4> | |||
{{Template:BadJournal:New syntax}} | {{Template:BadJournal:New syntax}} | ||
<h4>Syntax terms</h4> | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%badJournal</th> | <tr><th>%badJournal</th> | ||
Line 67: | Line 67: | ||
{{Template:BadJournal:ReasonCode subtitle}} | {{Template:BadJournal:ReasonCode subtitle}} | ||
<h4>Syntax</h4> | |||
{{Template:BadJournal:ReasonCode syntax}} | {{Template:BadJournal:ReasonCode syntax}} | ||
<h4>Syntax terms</h4> | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%number</th> | <tr><th>%number</th> |
Revision as of 22:25, 9 May 2011
The BadJournal exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the Journal class constructor.
An instance of the BadJournal exception class may be automatically thrown by the New constructor of the Journal class; it is explicitly created with the New constructor of the BadJournal class.
The following example shows a "Try and Catch" of a Journal class, New method, exception. An invalid journal name is specified to generate the BadJournal exception. For more information about catching thrown exceptions, see "Try and Catch".
begin %sl is object stringlist %rc is float %journal is object journal %bdjrnl is object badJournal try printText {~} is: {%journal = new('OLD~RNL')} catch badJournal to %bdjrnl print 'Failure!!! Reason code is: ' %bdjrnl:reasonCode end try %rc = %sl:appendJournalData( - Options='MAXIO=1000 WIDTH=138 ST AA USER', - Threads='*', Journal=%journal) print %rc print %sl:count %sl:print end
AppendJournalData does not cancel if its Journal parameter is null. The request result shows the reason code stored in the exception object:
%journal = new('OLD~RNL') is: Failure!!! Reason code is: 1 0 0
Note: In order to display the reason code associated with the request, the exception is caught to a BadJournal object variable, against which the ReasonCode method runs.
The BadJournal class is available as of Sirius Mods Version 7.8.
The BadJournal methods
The following are the available BadJournal class methods.
Method | Description |
---|---|
New | Create a new BadJournal object |
ReasonCode | Numeric code indicating cause of BadJournal exception |
The methods in the class are described in the subsections that follow. In addition:
- "Notation conventions for methods" has information about the conventions followed.
- "BadJournal methods syntax" is a single page that contains the syntax diagrams of all the methods in the class.
New constructor
Create a new BadJournal object (BadJournal class)
[Introduced in Sirius Mods 7.8]
The New constructor generates an instance of a BadJournal exception object, optionally also setting the ReasonCode property.
Syntax
%badJournal = [%(BadJournal):]New( ReasonCode= number)
Syntax terms
%badJournal | A reference to an instance of a BadJournal object. |
---|---|
%(BadJournal) | The class name in parentheses denotes a shared method. |
ReasonCode | This optional, but name required parameter ReasonCode, specifies the numeric reason code to be assigned to the BadJournal exception object's ReasonCode property when a daemon thread is lost.
The possible values are described in "ReasonCode property". |
ReasonCode property
Numeric code indicating cause of BadJournal exception (BadJournal class)
[Introduced in Sirius Mods 7.8]
Syntax
%number = badJournal:ReasonCode
Syntax terms
%number | This is a numeric variable to receive the code describing the reason the exception was thrown. Possible values include:
| ||||||||
---|---|---|---|---|---|---|---|---|---|
badJournal | A reference to an instance of a BadJournal object. |