Using API / Subprogram N-CHKCOO

The subprogram is delivered in library SYSDIC. It checks the status of the coordinator file.

This section covers the following topics:


Calling the Subprogram

Copy N-CHKCOO to your application libray. The following example shows

The example program below checks the status of the coordinator file assigned to the specified FDIC file. If the coordinator file can be used for load, the example program executes some direct commands. During the execution of the direct commands, no additional input is necessary. If the coordinator file cannot be used for load, the returned messages are printed.

The example shows that it is possible to initiate a load process from an application library and to return control to the application.

   0010 /* Example program for online loading from application
   0020 /*
   0030 DEFINE DATA LOCAL
   0040    01  #DBNR   (N5) /* i - DBNr of FDIC (if not specified current FDIC
   0050                     /*     is used)
   0060    01  #FNR    (N5) /* i - FNr of FDIC (if not specified current FDIC
   0070                     /*     is used)
   0080    01  #PASS   (A8) /* i - password of FDIC (optional)
   0090    01  #CIPH   (N8) /* i - cipher code of FDIC (optional)
   0100    01  #USER   (A8) /* o - user who is active on coordinator FDIC
   0110    01  #TID    (A8) /* o - terminal ID of active user
   0120    01  #L-DB   (N5) /* o - DBNr of FDIC coordinator is used for
   0130    01  #L-FN   (N5) /* o - FNr of FDIC coordinator is used for
   0140    01  #MSG    (A80)/* o - information about error
   0150    01  #MSG2   (A80)/* o - information about error
   0160    01  #RESP   (I4) /* o - 0 coordinator file is empty
   0170                     /*  ne 0 coordinator/FDIC file is used/invalid.
   0180 END-DEFINE
   0190 *
   0200 CALLNAT 'N-CHKCOO' #DBNR #FNR #PASS #CIPH #USER #TID #L-DB #L-FN
   0210                    #MSG #MSG2 #RESP
   0220 IF #RESP NE 0
   0230    PRINT '=' #RESP
   0240      /   '=' #USER
   0250      /   '=' #TID
   0260      /   '=' #L-DB
   0270      /   '=' #L-FN
   0280      /   '=' #MSG
   0290      /   '=' #MSG2
   0300 ELSE
   0310    RELEASE STACK
   0320    STACK TOP DATA 'END'
   0330    STACK TOP DATA 'LOAD OBJ ALL REPLACE=Y'
   0340    STACK TOP DATA
   0350     'SET MEDIUM-TYPE=D MEDIUM-ID=EMPLOY MEDIUM-DBNR=180 MEDIUM-FNR=200'
   0360    STACK TOP DATA 'SET 188 32 '
   0370    STACK TOP COMMAND 'CMD'
   0380    STACK TOP COMMAND 'LOGON SYSDICBE'
   0390    STACK TOP COMMAND 'SETUP *,I'
   0400 END-IF
   0410 END