BadJournal class: Difference between revisions
m (few more tags) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<!-- BadJournal class --> | <!-- BadJournal class --> | ||
The <var>BadJournal</var> exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the <var>[[Journal class]]</var> constructor. | The <var>BadJournal</var> exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the <var>[[Journal class]]</var> constructor. | ||
<p>An instance of the <var>BadJournal</var> exception class may be automatically thrown by the | <p>An instance of the <var>BadJournal</var> exception class may be automatically thrown by the <var>[[New (Journal constructor)|New]]</var> constructor of the <var>Journal class|Journal</var> class, or explicitly created with the "<var>[[New_(BadJournal_constructor)|BadJournal Class New Constructor]]</var>".</p> | ||
The following example shows a "[[Try and Catch]]" of a <var>Journal</var> class, <var>New</var> method, exception. An invalid journal name is specified to generate the <var>BadJournal</var> exception. For more information about catching thrown exceptions, see "[[Try and Catch]]". | |||
<p class="code">begin | <p class="code">begin | ||
%sl is object [[Stringlist class|stringlist]] | %sl is object [[Stringlist class|stringlist]] | ||
Line 29: | Line 29: | ||
0 | 0 | ||
</p> | </p> | ||
<b | <b>Note:</b> In order to display the reason code associated with the request, the exception is caught to a <var>BadJournal</var> object variable, against which the <var>[[ReasonCode_(BadJournal_property)|ReasonCode]]</var> method runs. | ||
The <var>BadJournal</var> class is available as of <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.8. | |||
<h2>The BadJournal methods</h2> | |||
{{Template:List of BadJournal methods}} | |||
The methods in the class are described in the subsections that follow. In addition: | |||
<ul> | |||
<li>[[Notation conventions for methods|"Notation conventions for methods"]] has information | |||
about the conventions followed. | |||
<li>[[AddToRecordError methods syntax|"AddToRecordError methods syntax"]] is a single page that contains the syntax diagrams of all the methods in the class. | |||
</ul> | </ul> | ||
[[Category:System exception classes]] | [[Category:System exception classes]] |
Revision as of 20:48, 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|Journal class, or explicitly created with the "BadJournal Class New Constructor".
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.
- "AddToRecordError methods syntax" is a single page that contains the syntax diagrams of all the methods in the class.