FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 1   

LSTDIF.FTN   	/TR:BLOCKS/WR


        C

        C

        C

        C	LSTDIF -- OUTPUT A LIST OF DIFFERENCES

        C

        C

        C

        C

        C	COPYRIGHT (C) 1976

        C	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

        C

        C	THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

        C	SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

        C	SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

        C	OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

        C	AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

        C	AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

        C	OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

        C

        C	THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

        C	NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

        C	EQUIPMENT CORPORATION.

        C

        C	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

        C	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

        C

        C

        C	K.D. MORSE  22-NOV-76

        C

        C

        C

        C

        C	THIS SUBROUTINE WRITES DIF OUTPUT AS A LIST OF DIFFERENCES,

        C	FIRST THE INPUT-FILE AND THEN THE COMPARE-FILE.

        C

        C

        C

        C

        C

        C  MODIFICATIONS:

        C

        C NO		DATE		PROGRAMMER		PURPOSE

        C --		-----		----------		-------

        C

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 2   

LSTDIF.FTN   	/TR:BLOCKS/WR


         

        C

        C  VARIABLES:

        C

        C	CLUN--LOGICAL UNIT NUMBER FOR OPENING COMPARE FILE CHANNEL

        C	CNMLNG--LENGTH OF THE COMPARE FILE SPECIFICATION

        C	COMNAM--COMPARE FILE SPECIFICATION

        C	COMREC--I/O BUFFER FOR COMPARE FILE RECORDS

        C	COUT--NUMBER OF COMPARE-FILE RECORDS OUTPUT (I.E., UNMATCHED)

        C	CSTAT--INDICATOR OF TYPE OF CLOSE FOR COMPARE FILE LUN

        C	CTYPE--TYPE OF OPEN FOR COMPARE FILE (0=INPUT, 1=OUTPUT)

        C	IERR1--ERROR INDICATOR FROM FORTRAN ROUTINES

        C	IERR2--ERROR INDICATOR FROM MACRO ROUTINES

        C	ILUN--LOGICAL UNIT NUMBER FOR OPENING INPUT FILE CHANNEL

        C	INMLNG--LENGTH OF THE INPUT FILE SPECIFICATION

        C	INOUT--INDICATOR FOR TYPE OF LINE EDIT, 0 = INPUT, <0 = OUTPUT

        C	       ALSO IS INCREMENTED AS COUNT OF NUMBER OF TYPES OF OUTPUT

        C	       ALREADY PRODUCED (USED TO TELL WHEN TO OUTPUT HEADERS)

        C	INPNAM--ASCII INPUT FILE SPECIFICATION

        C	IOUT--NUMBER OF INPUT-FILE RECORDS OUTPUT (I.E., UNMATCHED)

        C	IRECNM--CURRENT RECORD NUMBER

        C	IRECSZ--NUMBER OF CHARACTERS IN AN I/O BUFFER

        C	ISTAT--INDICATOR OF TYPE OF CLOSE FOR INPUT FILE CHANNEL

        C	ISUB--RECORD NUMBER OF THE INPUT RECORD BEING CURRECNTLY EXAMINED

        C	ISWTCH--VALUE OF SWITCHES SPECIFIED WITH INPUT FILE SPECIFICATION

        C	ITYPE--TYPE OF OPEN FOR INPUT FILE (0=INPUT, 1=OUTPUT)

        C	LENCOM--LENGTH OF COMPARE FILE RECORD

        C	LENG1--TEMPORARY STORAGE FOR LENGTH OF FILE SPECIFICATION

        C	LENG2--TEMPORARY STORAGE FOR LENGTH OF FILE SPECIFICATION

        C	LENINP--LENGTH OF INPUT FILE RECORD

        C	LSTMAT--LAST RECORD MATCHED BETWEEN THE TWO FILES

        C	MAP--MAPPING TABLE OF COMPARE FILE RECORDS ONTO INPUT FILE

        C		RECORDS, AND INPUT FILE RECORDS ONTO COMPARE FILE RECORDS

        C	MAPEND--RECORD NUMBER OF LAST RECORD THAT CAN BE MAPPED IN

        C		THE MAP TABLE

        C	MAPMRK--POINTERS TO NEXT RECORD OF MAP DATA TO READ

        C	MAPNAM--NAME OF MAP FILE

        C	MLUN--MAP FILE LUN

        C	MNMLNG--LENGTH OF MAP FILE NAME

        C	NSWVAL--ARRAY HOLDING VALUES TO TEST SWITCHES AGAINST

        C	NUMLIN--MAXIMUM NUMBER OF RECORDS PER FILE THAT CAN BE HELD IN

        C		THE MAP TABLE

        C	OLUN--LOGICAL UNIT NUMBER FOR OPENING OUTPUT FILE CHANNEL

        C	ONMLNG--LENGTH OF THE OUTPUT FILE SPECIFICATION

        C	OSTAT--STATUS OF TYPE OF CLOSE FOR OUTPUT FILE CHANNEL

        C	OSWTCH--VALUE OF SWITCHES SPECIFIED WITH OUTPUT FILE SPECIFICATION

        C	OUTMOD--MODE OF OUTPUT REQUESTED, I.E., ASCII, OCTAL, OR HEXADECIMAL

        C	OUTNAM--OUTPUT FILE SPECIFICATION

        C	RECORD--I/O BUFFER

        C

        C

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 3   

LSTDIF.FTN   	/TR:BLOCKS/WR


         

0001    	SUBROUTINE LSTDIF(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE,

        	1CLUN,CSTAT,COMREC,LENCOM,COMNAM,CNMLNG,CTYPE,OUTMOD)

        C

        C

0002    	COMMON MAP(100,2),NUMLIN,MAPTOP(2),LSTMAP(2),MLUN,

        	1IHOLD(30,2),NINCOR,IFREE(2),IFIRST(2),LAST(2),MAXBUF,

        	2BUFR,ISWTCH,COMCHR,NSWVAL(10),LSTMAT(2),IRECSZ,

        	3MRKPNT(4,2),INOUT,MAPEND(2),LINSIZ,MAPNAM,MNMLNG,MTYPE,MSTAT

        	4,IERR1,IERR2,IKIND,OLUN,MAPMRK(3,2),MPRINT,BARCHR

        C

        C

0003    	DIMENSION NOW(2)

0004    	INTEGER CLUN,OLUN,CTYPE,CSTAT,CNMLNG,COUT

0005    	BYTE INPNAM(1),COMNAM(1),COMCHR(16),BUFR(7680,2),MAPNAM(12)

0006    	BYTE OUTMOD,BARCHR,RECORD(512),COMREC(512)

         

        C

        C	HEADER FORMAT STATEMENT.

        C

0007    101	FORMAT(' ',<MIN0(LINSIZ,72)>('*')/' ',<MIN0(LINSIZ,72)/2-10>

        	1('*'),' LISTED DIFFERENCES ',<MIN0(LINSIZ,72)/2-10>

        	2('*'),/' ',<MIN0(LINSIZ,72)>('*')//)

0008    111	FORMAT(' ',20X,'RECORDS FROM FILE ',<LENG1>A1,

        	1/' ',18X,'WITHOUT A MATCH IN FILE ',<LENG2>A1//)

0009    121	FORMAT(' ',30X,'NONE')

0010    131	FORMAT('1')

        C

        C	OPEN MAP FILE.

        C

0011    	IOUT=0

        C

        C	OPEN ALL FILES.  MARK THE MAPPING FILE TWICE; ONCE FOR THE NEXT

        C	COMPARE MAPPING RECORD AND ONCE FOR THE NEXT INPUT MAPPING

        C	RECORD.

        C

0012    	COUT=0

0013    	CALL OPNFIL(MAPNAM,MNMLNG,MLUN,RECORD,IRECSZ,MTYPE,IERR2)

0014    	IF (IERR2 .LE. 0) GOTO 924

0015    300	CALL OPNFIL(INPNAM,INMLNG,ILUN,RECORD,IRECSZ,ITYPE,IERR2)

0016    	IF (IERR2 .LE. 0) GOTO 912

0017    	CALL OPNFIL(COMNAM,CNMLNG,CLUN,COMREC,IRECSZ,CTYPE,IERR2)

0018    	IF (IERR2 .LE. 0) GOTO 920

0019    	ISUB=1

0020    	CALL MRKREC(MLUN,MAPMRK(1,1),IERR2)

0021    	IF (IERR2 .LE. 0) GOTO 927

0022    	CALL MRKREC(MLUN,MAPMRK(1,2),IERR2)

0023    	IF (IERR2 .LE. 0) GOTO 927

0024    	IRECNM=1

        C

        C	GET A BUFFER'S WORTH OF INPUT-FILE RECORDS.

        C

0025    	CALL FILBUF(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE)

0026    	IF (IERR2 .EQ. 0) GOTO 305

0027    	IF (IERR1 .LT. 0) GOTO 1000

        C

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 4   

LSTDIF.FTN   	/TR:BLOCKS/WR


        C	WRITE HEADER.

        C

0028    305	IERR1=1

0029    	LENG1=INMLNG

0030    	LENG2=CNMLNG

0031    	IF (INOUT .GT. 1) WRITE(OLUN,131,ERR=918)

0032    	WRITE(OLUN,101,ERR=918)

0033    	WRITE(OLUN,111,ERR=918)(INPNAM(I),I=1,LENG1),(COMNAM(I),I=1,LENG2)

        C

        C	GET A TABLE'S WORTH OF INPUT-FILE MAP VALUES.

        C

0034    310	CALL READMP(ISUB)

0035    	IF (IERR2 .EQ. 0) GOTO 330

0036    	IF (IERR1 .LT. 0) GOTO 1000

        C

        C	WRITE OUT INPUT-FILE UNMATCHED RECORDS.

        C

0037    315	IF (MAP((IRECNM-MAPTOP(ISUB)+1),ISUB) .NE. 0) GOTO 320

0038    	LSTMAT(1)=IRECNM-1

0039    	CALL DIFOUT(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE,IRECNM

        	1,OUTMOD)

0040    	IOUT=IOUT+1

0041    	IF (IERR2 .EQ. 0) GOTO 330

0042    	IF (IERR1 .LT. 0) GOTO 1000

0043    320	IRECNM=IRECNM+1

0044    	IF (IRECNM .GT. MAPEND(ISUB)) GOTO 310

0045    	GOTO 315

        C

        C	DIFFERENCES FROM COMPARE FILE.

        C

0046    330	IF (IOUT .EQ. 0)WRITE(OLUN,121,ERR=918)

0047    	IERR1=1

0048    	IRECNM=1

        C

        C	GET A BUFFER'S WORTH OF COMPARE-FILE RECORDS.

        C

0049    	CALL FILBUF(CLUN,COMREC,LENCOM,CSTAT,COMNAM,CNMLNG,CTYPE)

0050    	IF (IERR2 .EQ. 0) GOTO 405

0051    	IF (IERR1 .LT. 0) GOTO 1000

        C

        C	WRITE OUT A HEADER.

        C

0052    405	IERR1=1

0053    	WRITE(OLUN,131,ERR=918)

0054    	LENG1=CNMLNG

0055    	LENG2=INMLNG

0056    	WRITE(OLUN,111,ERR=918)(COMNAM(I),I=1,LENG1),(INPNAM(I),I=1,LENG2)

0057    	ISUB=2

        C

        C	READ A MAPPING TABLE'S WORTH OF COMPARE-FILE MAP VALUES.

        C

0058    410	CALL READMP(ISUB)

0059    	IF (IERR2 .EQ. 0) GOTO 430

0060    	IF (IERR1 .LT. 0) GOTO 1000

        C

        C	OUTPUT COMPARE-FILE UNMATCHED RECORDS.

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 5   

LSTDIF.FTN   	/TR:BLOCKS/WR


        C

0061    415	IF (MAP((IRECNM-MAPTOP(ISUB)+1),ISUB) .NE. 0) GOTO 420

0062    	LSTMAT(2)=IRECNM-1

0063    	CALL DIFOUT(CLUN,COMREC,LENCOM,CSTAT,COMNAM,CNMLNG,CTYPE,IRECNM

        	1,OUTMOD)

0064    	COUT=COUT+1

0065    	IF (IERR2 .EQ. 0) GOTO 430

0066    	IF (IERR1 .LT. 0) GOTO 1000

0067    420	IRECNM=IRECNM+1

0068    	IF (IRECNM .GT. MAPEND(ISUB)) GOTO 410

0069    	GOTO 415

        C

        C	OUTPUT MESSAGE, "NONE", IF NO RECORDS WERE WRITTEN.

        C

0070    430	IF (COUT .EQ. 0)WRITE(OLUN,121,ERR=918)

0071    	IERR1=1

        C

        C	CLOSE FILES.

        C

0072    340	CALL CLSFIL(ILUN,ISTAT,IERR2)

0073    	IF (IERR2 .LE. 0) GOTO 913

0074    350	CALL CLSFIL(CLUN,CSTAT,IERR2)

0075    	IF (IERR2 .LE. 0) GOTO 921

0076    	GOTO 1000

        C

        C

        C	ERROR CODES

        C

        C

        C	INPUT FILE:

        C

        C		-12 = OPEN ERROR

        C		-13 = CLOSE ERROR

        C

        C	OUTPUT FILE:

        C

        C		-18 = READ/WRITE ERROR

        C

        C

        C	COMPARE FILE:

        C

        C		-20 = OPEN ERROR

        C		-21 = CLOSE ERROR

        C

        C	MAP FILE:

        C

        C		-24 = OPEN ERROR

        C		-25 = CLOSE ERROR

        C		-27 = MARK/POINT ERROR

        C

0077    912	IERR1=-12

0078    	GOTO 1000

0079    913	IERR1=-13

0080    	GOTO 1000

0081    918	IERR1=-18

0082    	GOTO 1000

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 6   

LSTDIF.FTN   	/TR:BLOCKS/WR


0083    920	IERR1=-20

0084    	GOTO 1000

0085    921	IERR1=-21

0086    	GOTO 1000

0087    924	IERR1=-24

0088    	GOTO 1010

0089    925	IERR1=-25

0090    	GOTO 1010

0091    927	IERR1=-27

0092    1000	CALL CLSFIL(MLUN,MSTAT,IERR2)

0093    	IF (IERR2 .LE. 0) GOTO 925

0094    1010	RETURN

0095    	END

FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 7   

LSTDIF.FTN   	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	002670   732		RW,I,CON,LCL

  2	$PDATA	000004     2		RW,D,CON,LCL

  3	$IDATA	000456   151		RW,D,CON,LCL

  4	$VARS	000022     9		RW,D,CON,LCL

  6	.$$$$.	037222  8009		RW,D,OVR,GBL





ENTRY POINTS



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 LSTDIF	      1-000000





VARIABLES



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 BARCHR	L*1   6-037220	 CLUN	I*2   F-000020*	 CNMLNG	I*2   F-000032*	 COUT	I*2   4-000004	 CSTAT	I*2   F-000022*

 CTYPE	I*2   F-000034*	 I	I*2   4-000020	 IERR1	I*2   6-037172	 IERR2	I*2   6-037174	 IKIND	I*2   6-037176

 ILUN	I*2   F-000002*	 INMLNG	I*2   F-000014*	 INOUT	I*2   6-037140	 IOUT	I*2   4-000012	 IRECNM	I*2   4-000016

 IRECSZ	I*2   6-037116	 ISTAT	I*2   F-000010*	 ISUB	I*2   4-000014	 ISWTCH	I*2   6-037044	 ITYPE	I*2   F-000016*

 LENCOM	I*2   F-000026*	 LENG1	I*2   4-000006	 LENG2	I*2   4-000010	 LENINP	I*2   F-000006*	 LINSIZ	I*2   6-037146

 MAXBUF	I*2   6-001042	 MLUN	I*2   6-000632	 MNMLNG	I*2   6-037164	 MPRINT	I*2   6-037216	 MSTAT	I*2   6-037170

 MTYPE	I*2   6-037166	 NINCOR	I*2   6-001024	 NUMLIN	I*2   6-000620	 OLUN	I*2   6-037200	 OUTMOD	L*1   F-000036*





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 BUFR	L*1   6-001044	036000  7680	(7680,2)

 COMCHR	L*1   6-037046	000020     8	(16)

 COMNAM	L*1   F-000030*	000001     0	(1)

 COMREC	L*1   F-000024*	001000   256	(512)

 IFIRST	I*2   6-001032	000004     2	(2)

 IFREE	I*2   6-001026	000004     2	(2)

 IHOLD	I*2   6-000634	000170    60	(30,2)

 INPNAM	L*1   F-000012*	000001     0	(1)

 LAST	I*2   6-001036	000004     2	(2)

 LSTMAP	I*2   6-000626	000004     2	(2)

 LSTMAT	I*2   6-037112	000004     2	(2)

 MAP	I*2   6-000000	000620   200	(100,2)

 MAPEND	I*2   6-037142	000004     2	(2)

 MAPMRK	I*2   6-037202	000014     6	(3,2)

 MAPNAM	L*1   6-037150	000014     6	(12)

 MAPTOP	I*2   6-000622	000004     2	(2)

 MRKPNT	I*2   6-037120	000020     8	(4,2)

 NOW	I*2   4-000000	000004     2	(2)

 NSWVAL	I*2   6-037066	000024    10	(10)

 RECORD	L*1   F-000004*	001000   256	(512)



FORTRAN IV-PLUS V02-51D		02:42:05    22-AUG-78		PAGE 8   

LSTDIF.FTN   	/TR:BLOCKS/WR




LABELS



 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	



 101'	 3-000000	 111'	 3-000104	 121'	 3-000210	 131'	 3-000224	 300	    **   

 305	 1-000524	 310	 1-000766	 315	 1-001030	 320	 1-001230	 330	 1-001262

 340	    **   	 350	    **   	 405	 1-001446	 410	 1-001666	 415	 1-001730

 420	 1-002124	 430	 1-002156	 912	 1-002324	 913	 1-002342	 918	 1-002360

 920	 1-002376	 921	 1-002414	 924	 1-002432	 925	 1-002450	 927	 1-002466

 1000	 1-002502	 1010	 1-002532





FUNCTIONS AND SUBROUTINES REFERENCED



 CLSFIL	 DIFOUT	 FILBUF	 MRKREC	 OPNFIL	 READMP	 $MIN0





TOTAL SPACE ALLOCATED = 042616  8903



NO FPP INSTRUCTIONS GENERATED



OBJ$:LSTDIF,LIS$:LSTDIF/-SP=SRC$:LSTDIF

