BadJournal class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "<!-- BadJournal class --> The BadJournal exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the [[Journal ...")
 
m (1 revision)
(No difference)

Revision as of 21:26, 16 January 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.

The New constructor of the Journal system class is the system method that automatically throws a BadJournal exception. For information about catching a thrown exception, see ?? refid=tryctch..

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:

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

The AppendJournalData method 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 methods in this class are listed at "List of BadJournal methods".

The BadJournal class is available as of Sirius Mods version 7.8.