Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Message output to S variables

&pagelevel(3)&pagelevel

For a number of messages, message code and inserts (number and meaning) are guaranteed as invariable components of future PERCON and BS2000 versions. These messages are referred to as guaranteed messages.

Guaranteed messages of the PERCON product

The following types of PERCON messages are guaranteed messages:

  • messages concerning PERCON start and termination

  • messages indicating the number of records or blocks processed

  • messages with inserts such as DMS error codes, file names etc.

  • messages triggered by errors other than violations of the syntax or semantics of statements (e.g. records in a file that are too short)

The following is a list of guaranteed PERCON messages:


PER0000         PERCON started 
PER0001         PERCON run aborted 
PER0002         Error in a system macro 
PER0003         Insufficient memory space 
PER0004         File not on specified type of volume 
PER0009         Output record length exceeds maximum length 
PER0012         Inconsistency in file names 
PER0014         Alternate (secondary) keys not transferred
PER0016         DMS error while repairing file 
PER0017 - 19    XHCS problems 
PER0021 - 23    OPEN/CLOSE problems 
PER0028         Link error in user modules 
PER0029 - 30    Number of processed blocks/records 
PER0031         PERCON terminated normally 
PER0035         ISAM key not ascending 
PER0036         DMS error
PER0038         Abnormal termination due to parity or length error 
PER0039         CCSN incompatible with SYSOUT 
PER0041 - 42    Error in data record 
PER0044         Data record too short 
PER0045         Data records not in sequence 
PER0048         Invalid return code from a user routine 
PER0053 - 54    Output file incompatible with FILLER=*OUTPUT 
PER0057         Device error during positioning 
PER0069         Error during tape duplication 
PER0092 - 94    File repairing using VERIF 
PER0095         Prelinked PERCON module cannot be loaded 
PER0098         ISAM key already exists 
PER0099 - 103   Error during alternate (secondary) key transfer 
PER0104 - 107   PERCON version not available 
PER0109         CCSN for output file cannot be recorded 
PER0110         Invalid BS2000 version 
PER0111         BIND error during dynamical loading of prelinked module  


When using the software product SDF-P, these guaranteed messages can be output in structured S variables. S variables provide direct access to specific message data even if the output layout of the messages is unknown. This permits further processing to be controlled in SDF-P procedures depending on the contents of this S variables.

Guaranteed messages are provided with the message attribute "Warranty : YES".

How to proceed

An S variable that is to be supplied with messages must be built as a list of structures. Its name is optional; varname is used as its name in this section.
The user has to declare the S variable using the following command:

/DECLARE-VARIABLE NAME=varname(TYPE=*STRUCTURE(DEFINITION=*DYNAMIC)),-

/ MULTIPLE-ELEMENTS=*LIST,SCOPE=*TASK

Note

Specifying SCOPE=*TASK is not required unless the S variable is to be valid also in procedures called after declaring the S variable.

Each structure (message) is to consist of the following elements:

Name of the structure elementContents
varname(*LIST).MSG-TEXTComplete message text
varname(*LIST).MSG-IDMessage code
varname(*LIST).I0Insert 0
varname(*LIST).I1Insert 1
. . .. . .
varname(*LIST).I14Insert 14
varname(*LIST).REPLY

Entered response


The number of inserts depends on the message; the same applies to presence or absence of a response.

Once the S variable has been declared, it is assigned the message stream by means of the following command:

/ASSIGN-STREAM STREAM-NAME=SYSMSG,TO=*VARIABLE(varname)

After this has been done, PERCON or a program which invokes PERCON as a subprogram can be started. During the PERCON/program run, messages are stored in the S variable.

After PERCON or program termination, the message stream to the S variable is stopped and reassigned to the default output destination for messages:

/ASSIGN-STREAM STREAM-NAME=SYSMSG,TO=*STD

The variable varname contains all guaranteed messages output between the two ASSIGN-STREAM commands. In particular, these include the BLS messages.

If PERCON is invoked as a subprogram, the S variable additionally contains all guaranteed messages output by the main program.

If the output of additional messages is to be suppressed, the two ASSIGN-STREAM commands can be executed via a CMD macro immediately before and after PERCON is called in the main program.

Messages are output to the S variables, whether message output to SYSOUT or SYSLST is suppressed during this time or not.

For a more detailed description of S variables please refer to the manual [13] "SDF-P".

Evaluating S variables

The contents of an S variable can be output using the SHOW-VARIABLE command. The following is an example of the contents of an S variable ’PERVAR’ after termination of the PERCON run:

/show-variable variable-name=pervar
PERVAR(*LIST).MSG-TEXT = % BLS0517 MODULE 'PCROOT' GELADEN
PERVAR(*LIST).MSG-ID = BLS0517
PERVAR(*LIST).I0 = PCROOT
PERVAR(*LIST).MSG-TEXT = % PER0000 PERCON GESTARTET, VERSION V03.0A00
PERVAR(*LIST).MSG-ID = PER0000
PERVAR(*LIST).I0 = V03.0A00
PERVAR(*LIST).MSG-TEXT = % PER0044 FELD IN 'SET-RECORD-MAPPING'-ANWEISUNG
UEBERRAGT EIN-/AUSGABE-SATZENDE, LINK='PCOUT'
PERVAR(*LIST).MSG-ID = PER0044
PERVAR(*LIST).I0 = SET-RECORD-MAPPING
PERVAR(*LIST).I1 = PCOUT
PERVAR(*LIST).MSG-TEXT = % PER0030 ANZAHL VERARBEITETER SAETZE FUER
LINK='PCIN' :         3
PERVAR(*LIST).MSG-ID = PER0030
PERVAR(*LIST).I0 = PCIN
PERVAR(*LIST).I1 =
PERVAR(*LIST).I2 =           3
PERVAR(*LIST).MSG-TEXT = %  PER0030 ANZAHL VERARBEITETER SAETZE FUER
LINK='PCOUT' (FILE=:catid:$userid.XXX):          2
PERVAR(*LIST).MSG-ID = PER0030
PERVAR(*LIST).I0 = PCOUT
PERVAR(*LIST).I1 = (FILE=:catid:$userid.XXX)
PERVAR(*LIST).I2 =           2
PERVAR(*LIST).MSG-TEXT = %  PER0001 PERCON-LAUF ABGEBROCHEN
PERVAR(*LIST).MSG-ID = PER0001


The individual structure elements of the variable can be addressed separately
(e.g. /show-variable variable-name=pervar#3.MSG-ID obtains the message code of the third message).

The following example shows a section of an SDF-P procedure containing a FOR loop that stores guaranteed messages in S variables:

/DECLARE-VARIABLE NAME=PERVAR(TYPE=*STRUCTURE), - —————————————————————  (1) 
/                 MULTIPLE-ELEMENTS=*LIST 
/DECLARE-VARIABLE NAME=PERSTR(TYPE=*STRUCTURE) ————————————————————————  (2) 
/ASSIGN-STREAM STREAM-NAME=SYSMSG,TO=*VARIABLE(PERVAR) ————————————————  (3) 
/START-PERCON —————————————————————————————————————————————————————————  (4) 
. 
...   (PERCON statements etc.) 
.
/ASSIGN-STREAM STREAM-NAME=SYSMSG,TO=*STD —————————————————————————————  (5) 
/FOR PERSTR= *LIST(PERVAR) ————————————————————————————————————————————  (6) 
/    IF (PERSTR.MSG-ID = 'PER0001') 
/        WRITE-TEXT '*------------------------------------*'
/        WRITE-TEXT '* PERCON ABORTED / RESPONSE REQUIRED *'
/        WRITE-TEXT '*------------------------------------*'
/    END-IF 
/END-FOR    

(1)

The S variable PERVAR is declared as a list of structures.

(2)

The structure variable PERSTR is declared for the subsequent FOR loop.

(3)

Guaranteed messages are stored in PERVAR following this command.

(4)

PERCON is started.

(5)

Output of guaranteed messages to PERVAR is stopped by this command.

(6)

A FOR loop searches the entire list of structures PERVAR looking for an occurrence of the message code PER0001 as MSG-ID. If it is found, information is output with WRITE-TEXT.

The error messages are output in 7-character (PERnnnn) form, together with an explanation and any actions which must be taken, either in English or in German.

The scope of the interactive messages can be controlled by means of specifications in the MODIFY-PERCON-OPTIONS statement.