*DECK NDLMAIN
USETEXT NDLTBLT
PROC NDLMAIN;
BEGIN
*IF,DEF,IMS
#
** NDLMAIN - NDLP MAIN PROCEDURE.
*
* D.K. ENDO 81/10/12
*
* THIS IS THE MAIN PROCEDURE FOR NDLP.
*
* PROC NDLMAIN
*
* ENTRY NONE.
*
* EXIT NONE.
*
* MESSAGES LFN - NO ERRORS ENCOUNTERED.
* LFN - XXX ERRORS AND YY WARNINGS.
* NDLP COMPLETE.
*
* METHOD
*
* LOAD INITIALIZATION OVERLAY.
* IF THIS IS A CREATION RUN,
* THEN,
* FOR EACH DIVISION UNTIL EOI,
* LOAD PASS 1 OVERLAY.
* IF THIS IS NCF DIVISION,
* THEN
* LOAD NCF OVERLAY.
* OTHERWISE,
* IF THIS IS LCF DIVISION,
* LOAD LCF OVERLAY.
* LOAD LIST OVERLAY.
* SEND ERROR MESSAGE TO DAYFILE
* RETURN ALL THE SCRATCH FILES
* OTHERWISE
* LOAD LIST OVERLAY.
* SEND NDLP COMPLETE MESSAGE TO DAYFILE.
*
#
*ENDIF
#
**** PROC NDLMAIN - XREF LIST BEGINS.
#
XREF
BEGIN
PROC ABORT; # ABORTS JOB ON REQUEST #
PROC NDLOVLD; # LOADS OVERLAY #
PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT IS SET #
PROC RETERN; # RETURNS FILE ON REQUEST #
PROC MESSAGE; # PUTS MESSAGE INTO DAYFILE #
FUNC XCDD C(10); # CONVERT INTEGER TO DECIMAL DISPLAY CODE #
FUNC XSFW C(10); # BLANK FILL A ZERO FILLED NAME #
END
#
****
#
CONTROL PRESET;
CONTROL NOLIST; # DATANDL, ER1CNDL, FETSNDL, OVLCNDL #
*CALL DATANDL
*CALL ER1CNDL
*CALL FETSNDL
*CALL OVLCNDL
CONTROL LIST;
ITEM CRNT$LFN C(10); # TEMPORARY FOR CURRENT FILE NAME #
ITEM CTEMP C(10); # CHARACTER TEMPORARY #
ITEM I; # USED IN MAIN FOR LOOP #
DEF MXERR # 999 #; # MAXIMUM NUMBER OF ERRORS #
ARRAY E$MSG1 [00:00] S(4); # LFN - NO ERRORS ENCOUNTERED. #
BEGIN
ITEM E$MSG1$TEXT C(00,00,33) =
[" - NO ERRORS ENCOUNTERED."];
ITEM E$MSG1$LFN C(00,06,07); # FILE NAME #
ITEM E$MSG1$ZBYT C(03,18,12) = [0]; # ZERO BYTE TERMINATOR #
END
ARRAY E$MSG2 [00:00] S(4); # LFN - X ERRORS AND Y WARNINGS.#
BEGIN
ITEM E$MSG2$TEXT C(00,00,39) =
[" - ERRORS AND WARNINGS."];
ITEM E$MSG2$LFN C(00,06,07); # FILE NAME #
ITEM E$MSG2$ECNT C(01,06,03); # ERROR COUNT FIELD #
ITEM E$MSG2$WCNT C(02,36,03); # WARNING COUNT FIELD #
ITEM E$MSG2$ZBYT C(03,48,12) = [0]; # ZERO BYTE TERMINATOR #
END
ARRAY NDLCOMP S(2);
ITEM
COMTEXT C(0,0,15) = [" NDLP COMPLETE."],
COMZERO U(1,30,30) = [0];
# NDLMAIN CODE BEGINS HERE #
# #
NTAB = MXTBLS; # SET NTAB TO FORCE LOADING OF TABLES CMN #
NDLOVLD(OVL$ENT[OVLY"INIT"]);# LOAD AND EXECUTE INIT OVERLAY #
IF CRERUN
THEN # THIS IS A CREATION RUN #
BEGIN
FOR I=0 STEP 1 WHILE NOT EOINP DO
BEGIN # EXECUTE UNTIL END OF INPUT IS FOUND #
NDLOVLD(OVL$ENT[OVLY"PSS1"]);# LOAD AND EXECUTE PASS 1 #
CRNT$LFN = " "; # CLEAR CURRENT FILE NAME #
IF NCFDIV # PROCESS NCF STATEMENTS #
THEN
BEGIN
NDLOVLD(OVL$ENT[OVLY"NCF"]);# LOAD NCF PROCESSOR #
CRNT$LFN = XSFW(NCFLFN[0]); # SAVE NCF FILE NAME #
END
ELSE # NOT AN NCF DIVISION #
BEGIN
IF LCFDIV # PROCESS LCF STATEMENTS #
THEN
BEGIN
NDLOVLD(OVL$ENT[OVLY"LCF"]); # LOAD LCF PROCESSOR #
CRNT$LFN = XSFW(LCFLFN[0]); # SAVE LCF FILE NAME #
END
END
NDLOVLD(OVL$ENT[OVLY"LIST"]);# LOAD AND EXECUTE LIST ROUTINE #
IF ERRCNT EQ 0 AND
WARNCNT EQ 0
THEN # IF THERE ARE NO ERRORS OR WARNINGS #
BEGIN
E$MSG1$LFN[0] = CRNT$LFN; # PUT FILE NAME IN MESSAGE #
MESSAGE(E$MSG1,0); # SENT MSG TO DAYFILE #
END
ELSE # ERRORS AND/OR WARNINGS ENCOUNTERED #
BEGIN
E$MSG2$LFN[0] = CRNT$LFN; # PUT FILE NAME IN MSG #
IF ERRCNT GR MXERR
THEN # ERROR COUNT EXCEEDS MAX #
BEGIN
ERRCNT = MXERR; # SET ERROR COUNT TO MAX #
END
CTEMP = XCDD(ERRCNT); # CONVERT TO DISPLAY CODE #
E$MSG2$ECNT[0] = C<7,3>CTEMP; # PUT ERROR COUNT IN MSG #
CTEMP = XCDD(WARNCNT); # CONVERT TO DISPLAY CODE #
E$MSG2$WCNT[0] = C<7,3>CTEMP; # PUT WARNING COUNT IN MSG#
MESSAGE(E$MSG2,0); # SEND MESSAGE TO DAYFILE #
IF ERRCNT GR 0 # IF FATAL ERROR EXIST #
THEN
BEGIN
ABRTFLG = TRUE; # SET ABORT FLAG #
END
END
END
RETERN(ERR1FET); # RETURN SCRATCH FILES #
RETERN(ERR2FET);
RETERN(ESIFET);
RETERN(LRFET);
RETERN(SECFET);
RETERN(STFET);
RECALL(STFET);
END #CREATION RUN#
ELSE #THIS IS A FILE SUMMARY RUN #
BEGIN
NDLOVLD(OVL$ENT[OVLY"LIST"]); # LOAD AND EXECUTE LIST ROUTINE #
END
MESSAGE(NDLCOMP,0); # SEND -NDLP COMPLETE- DAYFILE MESSAGE #
IF ABRTFLG # IF ABORT FLAG IS SET #
THEN
BEGIN
ABORT; # ABORT JOB #
END
RETURN;
END # NDLMAIN #
TERM