Google
 

Trailing-Edge - PDP-10 Archives - cobol12c - sort.ctl
There are 19 other files named sort.ctl in the archive. Click here to see a list.
!SORT.CTL	VERSION 4D
!USED TO MAKE COBOL, FORTRAN AND/OR STAND-ALONE SORT
!THIS FILE RUNS ON EITHER TOPS-20 OR TOPS-10
!SUBMIT WITH COMMAND	SUBMIT SORT/TIME:0:30:00/RESTART:YES
!
!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
!
!COPYRIGHT (C) 1979, 1985 BY DIGITAL EQUIPMENT CORPORATION
!ALL RIGHTS RESERVED
!
!IF ANY NON-STANDARD ASSEMBLY SWITCHES ARE DESIRED THEY SHOULD BE
!	INSERTED IN SRTPRM.MAC
!
!INSTALLATION SPECIFIC ASSIGNMENTS SHOULD BE PUT IN THE FOLLOWING FILE:
! ON TOPS-20 IN A TAKE FILE SORT.CMD
! ON TOPS-10 IN A MIC  FILE SORT.MIC
!	  OR IN A TECO FILE SORT.TEC
!NOTE, IN GENERAL THIS CONTROL FILE WILL NOT RUN WITHOUT ONE OF THE ABOVE
!DEFINITION FILES BEING PRESENT.
!
!IF LISTINGS ARE DESIRED, THE EMPTY FILE
!LISTEM.MAC SHOULD BE IN DSK:.
!
!THIS CONTROL FILE BY DEFAULT CREATES:
! IN SORT-BUILD:
!	STAND-ALONE SORT ALWAYS,
!
! IN COBOL-68-BUILD: (TOPS-20), OR C68: (TOPS-10)
!	COBOL-68 SORT IF LIBOL.REL IS PRESENT,
!
! IN COBOL-74-BUILD: (TOPS-20), OR C74: (TOPS-10)
!	COBOL-74 SORT IF C74LIB.REL IS PRESENT, AND
!
! IN DSK: ON TOPS-10
!	FORTRAN SORT IF FORLIB.REL IS PRESENT.
!
!TO CREATE JUST THE STAND-ALONE SORT, SUBMIT SORT.CTL WITH '/TAG:SORT'.
!TO CREATE JUST THE COBOL-68 SORT, SUBMIT SORT.CTL WITH '/TAG:COBOL'.
!TO CREATE JUST THE COBOL-74 SORT, SUBMIT SORT.CTL WITH '/TAG:CBL74'.
!ON TOPS-10 TO CREATE JUST THE FORTRAN SORT, SUBMIT SORT.CTL WITH '/TAG:FORTRA'.
!ON TOPS-10 TO CREATE THE VIRTUAL MEMORY FORTRAN SORT, SUBMIT SORT.CTL WITH '/TAG:FSORT'.
!
!NOTE
!COBOL-68 SORT AND COBOL-74 SORT BOTH REQUIRE FTDEFS.UNV AND THAT THAT FILE
!COULD BE IN TWO DIFFERENT AREAS. HOWEVER, FTDEFS IS INDEPENDANT OF COBOL-68
!AND COBOL-74 (THE CHECKSUM IS THE SAME) SO IT DOES NOT MATTER WHICH ONE IS USED.
!IN ALL CIRCUMSTANCES THE COBOL SORT WILL BE BUILT ONLY ONCE AND IF REQUIRED
!THE SAME VERSION WILL BE PUT INTO BOTH COBOL-68 AND COBOL-74.
START::
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
TOPS20::
@CHKPNT START::
!REQUIRED FILES:
!<FIELD-IMAGE>	MACRO.EXE
!		MAKLIB.EXE
!		CREF.EXE
!		LINK.EXE
!		MACTEN.UNV
!		MACSYM.UNV
!		MONSYM.UNV
!		MACREL.REL	(IF COBOL)
!
!<SYS>		PA1050.EXE
!
!<SELF>		SORT.CTL
!
!	SORT SOURCES
!<SORT-SOURCE>	COPYRT.MAC	SORT.MAC	SRTPRM.MAC	SRTSTA.MAC
!		SRTCMD.MAC	SRTJSS.MAC	SRTCMP.MAC	SRTFLT.MAC
!		SRTCBL.MAC	SRTCER.MAC	FORSRT.MAC
!
!	COBOL-68 & LIBOL FILES FROM VERSION 12C RELEASE
!<COBOL-68-BUILD>	LIBOL.REL
!			LIBSHR.REL
!			FTDEFS.UNV
!			METUNV.UNV
!
!	COBOL-74 & C74OTS FILES FROM VERSION 12C RELEASE
!<COBOL-74-BUILD>	C74LIB.REL
!			C74SHR.REL
!			FTDEFS.UNV
!			METUNV.UNV
!
!	LINK INDIRECT FILES TO LOAD THE COBOL OTS
!<COBOL-SOURCE>	L12C68.CMD	L12C74.CMD
!		L12C6D.CMD	L12C7D.CMD
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
@GET SYS:MACRO
@INFO VERSION
@GET SYS:MAKLIB
@INFO VERSION
@GET SYS:LINK
@INFO VERSION
@GET SYS:CREF
@INFO VERSION
@GET SYS:PA1050
@INFO VERSION
!
!GET CHECKSUMS SO WE KNOW WHAT WE HAVE
!FIRST THE SYSTEM SOFTWARE
!
@VD SYS:MACRO.EXE,SYS:MAKLIB.EXE,SYS:LINK.EXE,SYS:PA1050.EXE,SYS:CREF.EXE,UNV:MACTEN.UNV,UNV:MACSYM.UNV,UNV:MONSYM.UNV,SYS:MACREL.REL,
@CHECK SEQ
@
!
!NEXT THE SORT SOURCES
!
@VD SORT.MAC,SRT*.MAC,FORSRT.MAC,SORT.CTL,SORT.CMD,
@CHECK SEQ
@
!
!AND FINALLY THE COBOL FILES
!
@VD COBOL-68-BUILD:LIBO12.EXE,COBOL-68-BUILD:LIBOL.REL,COBOL-68-BUILD:LIBSHR.REL,COBOL-68-BUILD:FTDEFS.UNV,COBOL-68-BUILD:METUNV.UNV,
@CHECK SEQ
@
@VD COBOL-74-BUILD:C74O12.EXE,COBOL-74-BUILD:C74LIB.REL,COBOL-74-BUILD:C74SHR.REL,COBOL-74-BUILD:FTDEFS.UNV,COBOL-74-BUILD:METUNV.UNV,
@CHECK SEQ
@
@VD COBOL-SOURCE:L12C68.CMD,COBOL-SOURCE:L12C6D.CMD,COBOL-SOURCE:L12C74.CMD,COBOL-SOURCE:L12C7D.CMD,
@CHECK SEQ
@
!
!  CREATE STAND-ALONE SORT.
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT,COPYRT/C=COPYRT
*SORT,SORT/C=SORT20.VER,SRTPRM,SRTSTA,SRTCMD,SRTJSS,SRTCER,SRTCMP,SRTFLT,SORT
@IF (ERROR) @GOTO TRUBLE
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SORT.LZT=SORT
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SORT=SORT20.VER,SRTPRM,SRTSTA,SRTCMD,SRTJSS,SRTCER,SRTCMP,SRTFLT,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
@LINK
*SORT.MAP/MAP=SORT,/SYMSEG:HIGH/GO
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT.
!
@SAVE DSK:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
@DELETE SORT.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
@!GET TO MONITOR LEVEL
@GOTO LIBOL
TRUBLE::@PLEASE -- STAND-ALONE SORT CREATION UNSUCCESSFUL
@GOTO FAIL
TOPS10::
.CHKPNT START::
!REQUIRED FILES:
!SYS:		PIP.EXE		(LATEST RELEASED VERSIONS)
!		TECO.EXE
!		MACRO.EXE
!		MAKLIB.EXE
!		DIRECT.EXE
!		CREF.EXE
!		COMPIL.EXE
!		LINK.EXE+LNK???.EXE
!		SCAN.REL
!
!REL:		HELPER.REL
!
!UNV:		MACTEN.UNV
!		UUOSYN.UNV
!		SCNMAC.UNV
!
!DSK:		SORT.CTL	SORT.VER
!	OPTIONAL
!		SORT.CTM	SORT.TEC	SORT.MIC
!
!	SORT SOURCES
!SS:		SORT.MAC	SRTPRM.MAC	SRTSTA.MAC
!		SRTUUO.MAC	SRTSCN.MAC	SRTCMP.MAC
!		SRTFLT.MAC	SRTCBL.MAC	SRTCER.MAC
!		SRTFOR.MAC
!
!	COBOL-68 & LIBOL FILES FROM VERSION 12C RELEASE
!C68:		LIBOL.REL
!		FTDEFS.UNV
!		METUNV.UNV
!
!	COBOL-74 & C74OTS FILES FROM VERSION 12C RELEASE
!C74:		C74LIB.REL
!		FTDEFS.UNV
!		METUNV.UNV
!
!	FORTRAN FILES
!DSK:		FORLIB.REL
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF+LINK+LNK???+TECO
*TTY:/CHECKSUM=REL:HELPER.REL+SYS:SCAN.REL+UNV:MACTEN.UNV+UUOSYM.UNV+SCNMAC.UNV
*TTY:/CHECKSUM=DSK:SORT.*
*TTY:/CHECKSUM=SS:SORT.MAC+SRT???.MAC
*TTY:/CHECKSUM=C68:LIBOL.REL+FTDEFS.UNV+METUNV.UNV
*TTY:/CHECKSUM=C74:C74LIB.REL+FTDEFS.UNV+METUNV.UNV
*TTY:/CHECKSUM=DSK:FORLIB.REL
!
;
!  CREATE STAND-ALONE SORT.
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SORT,SORT/C=SORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SORT.LZT=SORT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SORT=SORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.R LINK
*SORT.MAP/MAP=SORT,-
*SYS:SCAN/SEGMENT:LOW/INCLUDE:(.VERBO,.TOUTS,.SAVE),-
*SYS:SCAN/EXCLUDE:(.VERBO,.TOUTS,.SAVE,$SCNDC),-
*REL:HELPER/G
.IF (ERROR) .GOTO TRUBLE
.SSAVE SORT
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
.DELETE SORT.REL
.IF (ERROR)!
!
.!GET TO MONITOR LEVEL
.GOTO LIBOL
TRUBLE::.PLEASE -- STAND-ALONE SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
LIBOL::	!  NOW FOR COBOL-68 CHANGES.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT LIBOL::
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  TEST TO SEE IF COBOL-68 SORT REQUIRED.
!
@ERROR %
@VD COBOL-68-BUILD:LIBOL.REL
@IF (ERROR) @GOTO C74OTS !NOT REQUIRED
@ERROR
!
!  ASSEMBLE SOURCES
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTINGS.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
!
!  PLACE INTO LIBOL.REL.
!
@MAKLIB
*LIBOL=LIBOL/MASTER:SORT,SRTCBL/REPLACE:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  INDEX LIBOL.REL.
!
@MAKLIB
*LIBOL=LIBOL/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!CREATE LIBO12.EXE
!CHECK TO SEE IF WE HAVE ANY DBMS MODULES
!
@MAKLIB
*DBGATE.TMP=LIBOL/EXTR:DBGATE
@IF (ERROR) @GOTO NODBMS
@DELETE DBGATE.TMP
@LINK
*@L12C6D.CMD
@IF (ERROR) @GOTO TRUBLE
@SAVE DSK:LIBO12 0 1,500 575,600 675
@IF (ERROR) @GOTO TRUBLE
@GOTO RENAME
!
NODBMS::
@LINK
*@L12C68.CMD
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT.
!
@SAVE DSK:LIBO12 0 675
@IF (ERROR) @GOTO TRUBLE
!
RENAME::
@!GET TO MONITOR LEVEL
!RENAME THE COBOL-68 FILES BACK TO THE COBOL-68 BUILD AREA
@RENAME LIBOL.REL COBOL-68-BUILD:LIBOL.REL
@IF (ERROR)!
@RENAME LIBO12.EXE COBOL-68-BUILD:LIBO12.EXE
@IF (ERROR)!
@RENAME LIBOL.MAP COBOL-68-BUILD:LIBOL.MAP
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
@GOTO C74OTS
TRUBLE::@PLEASE -- COBOL-68 SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT LIBOL::
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
!CHANGE THEM IF USER SO DESIRES
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!  TEST TO SEE IF COBOL-68 SORT REQUIRED.
!
.ERROR %
.DIR C68:LIBOL.REL
.IF (ERROR) .GOTO C74OTS !NOT REQUIRED
.ERROR
!
!  ASSEMBLE SOURCES WITH LISTINGS.
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.ERROR
!
!  JUST REPLACE SORT MODULE IN LIBOL.REL.
!
.R MAKLIB
*LIBOL=LIBOL/MASTER:SORT,SRTCBL/REPLACE:SORT
.IF (ERROR) .GOTO TRUBLE
!
INDEX::
!
!  INDEX LIBOL.REL
!
.R MAKLIB
*LIBOL=LIBOL/INDEX
.IF (ERROR) .GOTO TRUBLE
!
.!GET TO MONITOR LEVEL
!COPY THE COBOL-68 FILES BACK TO THE COBOL-68 BUILD AREA
!BUT ONLY DO THIS IF C68: IS NOT DEFINED TO BE DSK:
!IF THE COPY FAILS LEAVE THE FILES WHERE THEY ARE
!
.ERROR %
.R FILCOM
*NUL:/W=DSK:LIBOL.REL,C68:LIBOL.REL
.IF (NOERROR) .GOTO NOCOPY
.ERROR
.COPY C68:/X=DSK:LIBOL.REL
.IF (ERROR) .GOTO NOCOPY
.DELETE DSK:LIBOL.REL
.IF (ERROR) !TO BAD
!
NOCOPY::
.ERROR
.!GET TO MONITOR LEVEL
.GOTO C74OTS
TRUBLE::.PLEASE -- COBOL-68 SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
C74OTS::	!  NOW FOR COBOL-74 CHANGES.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT C74OTS::
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  TEST TO SEE IF COBOL-74 SORT REQUIRED.
!
@ERROR %
@VD COBOL-74-BUILD:C74LIB.REL
@IF (ERROR) @GOTO FORLIB !NOT REQUIRED
@ERROR
!
!TEST TO SEE IF COBOL-68 SORT HAS JUST BEEN ASSEMBLED.
!I.E. SRTCBL.REL AND LIBOL.REL BOTH EXIST
!
@ERROR %
!@VD COBOL-68-BUILD:LIBOL.REL
!@IF (ERROR) @GOTO ASSMBL	!COBOL-68 WAS NOT BUILT
!
@VD SRTCBL.REL
@IF (NOERROR) @GOTO DONCRF !ASSEMBLY NOT REQUIRED
@ERROR
!
ASSMBL::	!  ASSEMBLE SOURCES
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTINGS.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
@ERROR
!  PLACE INTO C74LIB.REL.
!
@MAKLIB
*C74LIB=C74LIB/MASTER:SORT,SRTCBL/REPLACE:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  INDEX C74LIB.REL.
!
@MAKLIB
*C74LIB=C74LIB/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!CREATE C74OT2.EXE
!CHECK TO SEE IF WE HAVE ANY DBMS MODULES
!
@MAKLIB
*DBGATE.TMP=C74LIB/EXTR:DBGATE
@IF (ERROR) @GOTO NODBMS
@DELETE DBGATE.TMP
@LINK
*@L12C7D.CMD
@IF (ERROR) @GOTO TRUBLE
@SAVE DSK:C74O12 0 1,500 575,600 675
@IF (ERROR) @GOTO TRUBLE
@GOTO RENAME
!
NODBMS::
@LINK
*@L12C74.CMD
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT. NOTE WE MUST GET RID OF PAGE 400 (A LINK BUG)
!BUT SAVE PAGE 0 AS IT MAKES IT EASIER TO PATCH
!ALSO DELETE PAGES 676 AND 677 SINCE COBOL-SORT USES THEM
!
@SAVE DSK:C74O12 0 675
@IF (ERROR) @GOTO TRUBLE
!
RENAME::
@!GET TO MONITOR LEVEL
!RENAME THE COBOL-74 FILES BACK TO THE COBOL- BUILD AREA
@RENAME C74LIB.REL COBOL-74-BUILD:C74LIB.REL
@IF (ERROR)!
@RENAME C74O12.EXE COBOL-74-BUILD:C74O12.EXE
@IF (ERROR)!
@RENAME C74OTS.MAP COBOL-74-BUILD:C74OTS.MAP
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
@GOTO FORLIB
TRUBLE::@PLEASE -- COBOL-74 SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT C74OTS::
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
!CHANGE THEM IF USER SO DESIRES
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!  TEST TO SEE IF COBOL-74 SORT REQUIRED.
!
.ERROR %
.DIR C74:C74LIB.REL
.IF (ERROR) .GOTO FORLIB !NOT REQUIRED
.ERROR
!
!TEST TO SEE IF COBOL-68 SORT HAS JUST BEEN ASSEMBLED.
!I.E. SRTCBL.REL AND LIBOL.REL BOTH EXIST
!
.ERROR %
.DIR LIBOL.REL
.IF (ERROR) .GOTO ASSMBL	!COBOL-68 NOT BUILT
!
.DIR SRTCBL.REL
.IF (NOERROR) .GOTO DONCRF !ASSEMBLY NOT REQUIRED
.ERROR
!
ASSMBL::	!  ASSEMBLE SOURCES
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.ERROR
!  PLACE INTO C74LIB.REL.
!
.R MAKLIB
*C74LIB=C74LIB/MASTER:SORT,SRTCBL/REPLACE:SORT
.IF (ERROR)!
!
!  INDEX C74LIB.REL
!
.R MAKLIB
*C74LIB=C74LIB/INDEX
.IF (ERROR) .GOTO TRUBLE
!
.!GET TO MONITOR LEVEL
!COPY THE COBOL-74 FILES BACK TO THE COBOL-74 BUILD AREA
!BUT ONLY DO THIS IF C74: IS NOT DEFINED TO BE DSK:
!IF THE COPY FAILS LEAVE THE FILES WHERE THEY ARE
!
.ERROR %
.R FILCOM
*NUL:/W=DSK:C74LIB.REL,C74:C74LIB.REL
.IF (NOERROR) .GOTO NOCOPY
.ERROR
.COPY C74:/X=DSK:C74LIB.REL
.IF (ERROR) .GOTO NOCOPY
.DELETE DSK:C74LIB.REL
.IF (ERROR) !TO BAD
!
NOCOPY::
.ERROR
.!GET TO MONITOR LEVEL
.GOTO FORLIB
FORLIB::	!  NOW FOR FORLIB CHANGES.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT FORLIB::
!
!@GOTO FINISH	!FORSRT PART OF FORTRAN RELEASE NOW
!
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  ASSEMBLE SOURCE
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*FORSRT,FORSRT/C=FORSRT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTING.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FORSRT.LZT=FORSRT
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*FORSRT=FORSRT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
!
!  TEST TO SEE IF FORTRAN SORT REQUIRED.
!
@ERROR %
@DIR FORLIB.REL
@IF (ERROR) @GOTO FINISH !NOT REQUIRED
@ERROR
!
!  PLACE INTO FORLIB.REL.
!  SEE IF WE HAVE ORIGINAL FORLIB OR A SORT MODIFIED ONE.
!
@MAKLIB
*SRTFOO=FORLIB/EXTRACT:SORT
@IF (NOERROR) @GOTO REPLAC
!
!  ORIGINAL FORLIB--PUT SORT AT THE END.
!
@MAKLIB
*FORLIB=FORLIB,FORSRT/APPEND
@IF (ERROR) @GOTO TRUBLE
@GOTO INDEX
!
REPLAC::
!
!  JUST REPLACE SORT MODULE.
!
@MAKLIB
*FORLIB=FORLIB/MASTER:SORT,FORSRT/REPLACE:SORT
@DELETE SRTFOO.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
INDEX::
!
!  INDEX FORLIB.REL.
!
@MAKLIB
*FORLIB=FORLIB/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
@DELETE FORSRT.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
@!GET TO MONITOR LEVEL
@GOTO FINISH
TRUBLE:@PLEASE -- FORTRAN SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT FORLIB::
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
!CHANGE THEM IF USER SO DESIRES
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!  ASSEMBLE SOURCES
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTFOR,SRTFOR/C=SORT.VER,SRTPRM,SRTFOR,SRTSTA,SRTSCN,SRTUUO,SRTCER,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTFOR.LZT=SRTFOR
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTFOR=SORT.VER,SRTPRM,SRTFOR,SRTSTA,SRTSCN,SRTUUO,SRTCER,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
!  CREATE TOPS-10 V/M STAND-ALONE SORT.
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*FSORT,FSORT/C=FSORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FSORT.LZT=FSORT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*FSORT=FSORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.R LINK
*FSORT.MAP/MAP=FSORT,-
*SYS:SCAN/SEGMENT:HIGH,-
*REL:HELPER/G
.IF (ERROR) .GOTO TRUBLE
.SSAVE FSORT
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
.DELETE FSORT.REL
.IF (ERROR)!
!
!  ASSEMBLE FORSRT
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*FORSRT,FORSRT/C=FORSRT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FORSRT.LZT=FORSRT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
!
.R MACRO
*COPYRT=COPYRT
*FORSRT=FORSRT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
!  TEST TO SEE IF FORTRAN SORT REQUIRED.
!
.ERROR %
.DIR FORLIB.REL
.IF (ERROR) .GOTO FINISH	!NOT REQUIRED
.ERROR
!  PLACE INTO FORLIB.REL.
!  SEE IF WE HAVE ORIGINAL FORLIB OR A SORT MODIFIED ONE.
!
.R MAKLIB
*SRTFOO=FORLIB/EXTRACT:SORT
.IF (NOERROR) .GOTO REPLAC
!
!  ORIGINAL FORLIB--PUT SORT AT THE END.
!
.R MAKLIB
*FORLIB=FORLIB,SRTFOR/APPEND
.IF (ERROR) .GOTO TRUBLE
.GOTO INDEX
!
REPLAC::
!
!  JUST REPLACE SORT MODULE.
!
.R MAKLIB
*FORLIB=FORLIB/MASTER:SORT,SRTFOR/REPLACE:SORT
.DELETE SRTFOO.REL
.IF (ERROR)!
!
INDEX::
!
!  INDEX FORLIB.REL.
!
.R MAKLIB
*FORLIB=FORLIB/INDEX
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
!.DELETE SRTFOR.REL
!.IF (ERROR)!
!
.!GET TO MONITOR LEVEL
.GOTO FINISH
TRUBLE::.PLEASE -- FORTRAN SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
SORT::	! HERE FOR STAND-ALONE SORT ONLY.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT SORT::
!
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
@GET SYS:MACRO
@INFO VERSION
@GET SYS:MAKLIB
@INFO VERSION
@GET SYS:LINK
@INFO VERSION
@GET SYS:CREF
@INFO VERSION
@GET SYS:PA1050
@INFO VERSION
!
!GET CHECKSUMS SO WE KNOW WHAT WE HAVE
!FIRST THE SYSTEM SOFTWARE
!
@VD SYS:MACRO.EXE,SYS:MAKLIB.EXE,SYS:LINK.EXE,SYS:PA1050.EXE,SYS:CREF.EXE,UNV:MACTEN.UNV,UNV:MACSYM.UNV,UNV:MONSYM.UNV,SYS:MACREL.REL,
@CHECK SEQ
@
!
!NEXT THE SORT SOURCES
!
@VD SORT.MAC,SRT*.MAC,FORSRT.MAC,SORT.CTL,SORT.CMD,
@CHECK SEQ
@
!
!
!  CREATE STAND-ALONE SORT.
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*SORT,SORT/C=SORT20.VER,SRTPRM,SRTSTA,SRTCMD,SRTJSS,SRTCER,SRTCMP,SRTFLT,SORT
@IF (ERROR) @GOTO TRUBLE
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SORT.LZT=SORT
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SORT=SORT20.VER,SRTPRM,SRTSTA,SRTCMD,SRTJSS,SRTCER,SRTCMP,SRTFLT,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
@LINK
*SORT.MAP/MAP=SORT,/SYMSEG:HIGH/GO
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT.
!
@SAVE DSK:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
@DELETE SORT.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
@!GET TO MONITOR LEVEL
@GOTO FINISH
TRUBLE::@PLEASE -- STAND-ALONE SORT CREATION UNSUCCESSFUL
@GOTO FAIL
TOPS10::
.CHKPNT SORT::
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF+LINK+LNK???+TECO
*TTY:/CHECKSUM=REL:HELPER.REL+SYS:SCAN.REL+UNV:MACTEN.UNV+UUOSYM.UNV+SCNMAC.UNV
*TTY:/CHECKSUM=DSK:SORT.*
*TTY:/CHECKSUM=SS:SORT.MAC+SRT???.MAC
!
;
!  CREATE STAND-ALONE SORT.
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SORT,SORT/C=SORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SORT.LZT=SORT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SORT=SORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.R LINK
*SORT.MAP/MAP=SORT,-
*SYS:SCAN/SEGMENT:LOW/INCLUDE:(.VERBO,.TOUTS,.SAVE),-
*SYS:SCAN/EXCLUDE:(.VERBO,.TOUTS,.SAVE,$SCNDC),-
*REL:HELPER/G
.IF (ERROR) .GOTO TRUBLE
.SSAVE SORT
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
.DELETE SORT.REL
.IF (ERROR)!
!
.!GET TO MONITOR LEVEL
.GOTO FINISH
TRUBLE::.PLEASE -- STAND-ALONE SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
COBOL::	!  HERE FOR COBOL-68 SORT ONLY.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT COBOL::
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  MAKE A RECORD OF WHAT IS BEING USED.
!
@GET SYS:MACRO
@INFO VERSION
@GET SYS:MAKLIB
@INFO VERSION
@GET SYS:LINK
@INFO VERSION
@GET SYS:CREF
@INFO VERSION
@GET SYS:PA1050
@INFO VERSION
!
!GET CHECKSUMS SO WE KNOW WHAT WE HAVE
!
@VD SYS:MACRO.EXE,SYS:MAKLIB.EXE,SYS:LINK.EXE,SYS:PA1050.EXE,SYS:CREF.EXE,UNV:MACTEN.UNV,UNV:MACSYM.UNV,UNV:MONSYM.UNV,SYS:MACREL.REL,
@CHECK SEQ
@
!
@VD SORT.*,SRT*.*,
@CHECK SEQ
@
!
@VD COBOL-68-BUILD:LIBO12.EXE,COBOL-68-BUILD:LIBOL.REL,COBOL-68-BUILD:LIBSHR.REL,COBOL-68-BUILD:FTDEFS.UNV,COBOL-68-BUILD:METUNV.UNV,
@CHECK SEQ
@
!
!  ASSEMBLE SOURCES 
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTINGS.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
@ERROR
!  PLACE INTO LIBOL.REL.
!
@MAKLIB
*LIBOL=LIBOL/MASTER:SORT,SRTCBL/REPLACE:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  INDEX LIBOL.REL.
!
@MAKLIB
*LIBOL=LIBOL/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!CREATE LIBO12.EXE
!CHECK TO SEE IF WE HAVE ANY DBMS MODULES
!
@MAKLIB
*DBGATE.TMP=LIBOL/EXTR:DBGATE
@IF (ERROR) @GOTO NODBMS
@DELETE DBGATE.TMP
@LINK
*@L12C6D.CMD
@IF (ERROR) @GOTO TRUBLE
@SAVE DSK:LIBO12 0 1,500 575,600 675
@IF (ERROR) @GOTO TRUBLE
@GOTO RENAME
!
NODBMS::
@LINK
*@L12C68.CMD
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT. NOTE WE MUST GET RID OF PAGE 400 (A LINK BUG)
!BUT SAVE PAGE 0 AS IT MAKES IT EASIER TO PATCH
!
@SAVE DSK:LIBO12 0 675
@IF (ERROR) @GOTO TRUBLE
!
RENAME::
@!GET TO MONITOR LEVEL
!RENAME THE COBOL-68 FILES BACK TO THE COBOL-68 BUILD AREA
@RENAME LIBOL.REL COBOL-68-BUILD:LIBOL.REL
@IF (ERROR)!
@RENAME LIBO12.EXE COBOL-68-BUILD:LIBO12.EXE
@IF (ERROR)!
@RENAME LIBOL.MAP COBOL-68-BUILD:LIBOL.MAP
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
@GOTO FINISH
TRUBLE::@PLEASE -- COBOL-68 SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT COBOL::
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF+LINK+LNK???+TECO
*TTY:/CHECKSUM=REL:HELPER.REL+SYS:SCAN.REL+UNV:MACTEN.UNV+UUOSYM.UNV+SCNMAC.UNV
*TTY:/CHECKSUM=SORT.*+SRT???.*
*TTY:/CHECKSUM=C68:LIBOL.REL+FTDEFS.UNV+METUNV.UNV
!
!  ASSEMBLE SOURCES
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
!
!  JUST REPLACE SORT MODULE IN LIBOL.REL.
!
.R MAKLIB
*LIBOL=LIBOL/MASTER:SORT,SRTCBL/REPLACE:SORT
.IF (ERROR) .GOTO TRUBLE
!
!  INDEX LIBOL.REL
!
.R MAKLIB
*LIBOL=LIBOL/INDEX
.IF (ERROR) .GOTO TRUBLE
!
.!GET TO MONITOR LEVEL
!COPY THE COBOL-68 FILES BACK TO THE COBOL-68 BUILD AREA
!BUT ONLY DO THIS IF C68: IS NOT DEFINED TO BE DSK:
!IF THE COPY FAILS LEAVE THE FILES WHERE THEY ARE
!
.ERROR %
.R FILCOM
*NUL:/W=DSK:LIBOL.REL,C68:LIBOL.REL
.IF (NOERROR) .GOTO NOCOPY
.ERROR
.COPY C68:/X=DSK:LIBOL.REL
.IF (ERROR) .GOTO NOCOPY
.DELETE DSK:LIBOL.REL
.IF (ERROR) !TO BAD
!
NOCOPY::
.ERROR
.!GET TO MONITOR LEVEL
.GOTO FINISH
TRUBLE::.PLEASE -- COBOL-68 SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
CBL74::	!  HERE FOR COBOL-74 SORT ONLY.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT CBL74::
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  MAKE A RECORD OF WHAT IS BEING USED.
!
@GET SYS:MACRO
@INFO VERSION
@GET SYS:MAKLIB
@INFO VERSION
@GET SYS:LINK
@INFO VERSION
@GET SYS:CREF
@INFO VERSION
@GET SYS:PA1050
@INFO VERSION
!
!GET CHECKSUMS SO WE KNOW WHAT WE HAVE
!
@VD SYS:MACRO.EXE,SYS:MAKLIB.EXE,SYS:LINK.EXE,SYS:PA1050.EXE,SYS:CREF.EXE,UNV:MACTEN.UNV,UNV:MACSYM.UNV,UNV:MONSYM.UNV,SYS:MACREL.REL,
@CHECK SEQ
@
!
@VD SORT.*,SRT*.*,
@CHECK SEQ
@
!
@VD COBOL-74-BUILD:C74O12.EXE,COBOL-74-BUILD:C74LIB.REL,COBOL-74-BUILD:LIBSHR.REL,COBOL-74-BUILD:FTDEFS.UNV,COBOL-74-BUILD:METUNV.UNV,
@CHECK SEQ
@
!
!  ASSEMBLE SOURCES 
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTINGS.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
*COPYRT=COPYRT
*SRTCBL=SORT20.VER,SRTPRM,SRTCBL,SRTCER,SRTJSS,SORT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
@ERROR
!  PLACE INTO C74LIB.REL.
!
@MAKLIB
*C74LIB=C74LIB/MASTER:SORT,SRTCBL/REPLACE:SORT
@IF (ERROR) @GOTO TRUBLE
!
!  INDEX C74LIB.REL.
!
@MAKLIB
*C74LIB=C74LIB/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!CREATE C74OT2.EXE
!CHECK TO SEE IF WE HAVE ANY DBMS MODULES
!
@MAKLIB
*DBGATE.TMP=C74LIB/EXTR:DBGATE
@IF (ERROR) @GOTO NODBMS
@DELETE DBGATE.TMP
@LINK
*@L12C7D.CMD
@IF (ERROR) @GOTO TRUBLE
@SAVE DSK:C74O12 0 1,500 575,600 675
@IF (ERROR) @GOTO TRUBLE
@GOTO RENAME
!
NODBMS::
@LINK
*@L12C74.CMD
@IF (ERROR) @GOTO TRUBLE
@INFO MEM
!
!NOW SAVE IT. NOTE WE MUST GET RID OF PAGE 400 (A LINK BUG)
!BUT SAVE PAGE 0 AS IT MAKES IT EASIER TO PATCH
!
@SAVE DSK:C74O12 0 675
@IF (ERROR) @GOTO TRUBLE
!
RENAME::
@!GET TO MONITOR LEVEL
!RENAME THE COBOL-74 FILES BACK TO THE COBOL- BUILD AREA
@RENAME C74LIB.REL COBOL-74-BUILD:C74LIB.REL
@IF (ERROR)!
@RENAME C74O12.EXE COBOL-74-BUILD:C74O12.EXE
@IF (ERROR)!
@RENAME C74OTS.MAP COBOL-74-BUILD:C74OTS.MAP
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
@GOTO FINISH
TRUBLE::@PLEASE -- COBOL-74 SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT CBL74::
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF+LINK+LNK???+TECO
*TTY:/CHECKSUM=REL:HELPER.REL+SYS:SCAN.REL+UNV:MACTEN.UNV+UUOSYM.UNV+SCNMAC.UNV
*TTY:/CHECKSUM=SORT.*+SRT???.*
*TTY:/CHECKSUM=C74:C74LIB.REL+FTDEFS.UNV+METUNV.UNV
!
!  ASSEMBLE SOURCES
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL,SRTCBL/C=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTCBL.LZT=SRTCBL
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTCBL=SORT.VER,SRTPRM,SRTCBL,SRTCER,SRTUUO,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
!  PLACE INTO C74LIB.REL.
!
.R MAKLIB
*C74LIB=C74LIB/MASTER:SORT,SRTCBL/REPLACE:SORT
.IF (ERROR)!
!
!  INDEX C74LIB.REL
!
.R MAKLIB
*C74LIB=C74LIB/INDEX
.IF (ERROR) .GOTO TRUBLE
!
.!GET TO MONITOR LEVEL
!COPY THE COBOL-74 FILES BACK TO THE COBOL-74 BUILD AREA
!BUT ONLY DO THIS IF C74: IS NOT DEFINED TO BE DSK:
!IF THE COPY FAILS LEAVE THE FILES WHERE THEY ARE
!
.ERROR %
.R FILCOM
*NUL:/W=DSK:C74LIB.REL,C74:C74LIB.REL
.IF (NOERROR) .GOTO NOCOPY
.ERROR
.COPY C74:/X=DSK:C74LIB.REL
.IF (ERROR) .GOTO NOCOPY
.DELETE DSK:C74LIB.REL
.IF (ERROR) !TO BAD
!
NOCOPY::
.ERROR
.!GET TO MONITOR LEVEL
.GOTO FINISH
TRUBLE::.PLEASE -- COBOL-74 SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
FORTRA::	!  HERE FOR FORTRAN SORT ONLY.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT FORTRA::
!
!@PLEASE -- FORTRAN SORT NOW PART OF FORTRAN RELEASE!!!
!@GOTO FINISH
!
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  MAKE A RECORD OF WHAT IS BEING USED.
!
@GET SYS:MACRO
@INFO VERSION
@GET SYS:MAKLIB
@INFO VERSION
@GET SYS:CREF
@INFO VERSION
@GET SYS:PA1050
@INFO VERSION
!
@VD SYS:MACRO.EXE,SYS:MAKLIB.EXE,SYS:CREF.EXE,UNV:MACSYM.UNV,UNV:MONSYM.UNV,SYS:PA1050.EXE,
@CHECK SEQ
@
!
VD FORSRT.MAC,
@CHECK SEQ
@
!
!  ASSEMBLE SOURCES
!
@ERROR %
@DIR LISTEM.MAC
@IF (ERROR) @GOTO NOLIST	!CREF NOT WANTED
!
@ERROR
@MACRO
FORSRT,FORSRT/C=FORSRT
@IF (ERROR) @GOTO TRUBLE
!
!  CREATE LISTINGS.
!
@CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FORSRT.LZT=FORSRT
@IF (ERROR) @GOTO TRUBLE
@GOTO DONCRF
!
NOLIST::
@ERROR
@MACRO
FORSRT=FORSRT
@IF (ERROR) @GOTO TRUBLE
!
DONCRF::
!
!  TEST TO SEE IF FORTRAN SORT REQUIRED.
!
@ERROR %
@DIR FORLIB.REL
@IF (ERROR) @GOTO FINISH !NOT REQUIRED
@ERROR
!
!  PLACE INTO FORLIB.REL.
!  SEE IF WE HAVE ORIGINAL FORLIB OR A SORT MODIFIED ONE.
!
@MAKLIB
*SRTFOO=FORLIB/EXTRACT:SORT
@IF (NOERROR) @GOTO REPLAC
!
!  ORIGINAL FORLIB--PUT SORT AT THE END.
!
@MAKLIB
*FORLIB=FORLIB,FORSRT/APPEND
@IF (ERROR) @GOTO TRUBLE
@GOTO INDEX
!
REPLAC::
!
!  JUST REPLACE SORT MODULE.
!
@MAKLIB
*FORLIB=FORLIB/MASTER:SORT,FORSRT/REPLACE:SORT
@DELETE SRTFOO.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
INDEX::
!
!  INDEX FORLIB.REL.
!
@MAKLIB
*FORLIB=FORLIB/INDEX
@IF (ERROR) @GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
@DELETE FORSRT.REL
@IF (ERROR)!
@EXPUNGE
@IF (ERROR)!
!
@!GET TO MONITOR LEVEL
@GOTO FINISH
TRUBLE::@PLEASE -- FORTRAN SORT CREATION UNSUCCESSFUL!!!
@GOTO FAIL
TOPS10::
.CHKPNT FORTRA::
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF
*TTY:/CHECKSUM=UNV:MACTEN.UNV+UNV:UUOSYM.UNV+UNV:SCNMAC.UNV
*TTY:/CHECKSUM=SORT.*+SRT???.*
*TTY:/CHECKSUM=FORLIB.REL
!  TEST TO SEE IF FORTRAN SORT REQUIRED.
!
.ERROR %
.DIR FORLIB.REL
.IF (ERROR) .GOTO FINISH	!NOT REQUIRED
.ERROR
!
!  ASSEMBLE SOURCES
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTFOR,SRTFOR/C=SORT.VER,SRTPRM,SRTFOR,SRTSTA,SRTSCN,SRTUUO,SRTCER,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:SRTFOR.LZT=SRTFOR
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*SRTFOR=SORT.VER,SRTPRM,SRTFOR,SRTSTA,SRTSCN,SRTUUO,SRTCER,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.ERROR
!  PLACE INTO FORLIB.REL.
!  SEE IF WE HAVE ORIGINAL FORLIB OR A SORT MODIFIED ONE.
!
.R MAKLIB
*SRTFOO=FORLIB/EXTRACT:SORT
.IF (NOERROR) .GOTO REPLAC
!
!  ORIGINAL FORLIB--PUT SORT AT THE END.
!
.R MAKLIB
*FORLIB=FORLIB,SRTFOR/APPEND
.IF (ERROR) .GOTO TRUBLE
.GOTO INDEX
!
REPLAC::
!
!  JUST REPLACE SORT MODULE.
!
.R MAKLIB
*FORLIB=FORLIB/MASTER:SORT,SRTFOR/REPLACE:SORT
.DELETE SRTFOO.REL
.IF (ERROR)!
!
INDEX::
!
!  INDEX FORLIB.REL.
!
.R MAKLIB
*FORLIB=FORLIB/INDEX
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
.DELETE SRTFOR.REL
.IF (ERROR)!
!
.!GET TO MONITOR LEVEL
.GOTO FINISH
TRUBLE::.PLEASE -- FORTRAN SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
FSORT::	!  HERE FOR TOPS-20 V/M FORTRAN SORT ONLY.
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
!
@PLEASE -- V/M FORTRAN SORT IS ONLY VALID ON TOPS-10!!!
@GOTO FAIL
TOPS10::
.CHKPNT FSORT::
!
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!MAKE A RECORD OF WHAT IS BEING USED
!
.R DIRECT
*TTY:/CHECKSUM=SYS:PIP+MACRO+MAKLIB+DIRECT+CREF+LINK+LNK???+TECO
*TTY:/CHECKSUM=REL:HELPER.REL+SYS:SCAN.REL+UNV:MACTEN.UNV+UUOSYM.UNV+SCNMAC.UNV
*TTY:/CHECKSUM=DSK:SORT.*+FSORT.*
*TTY:/CHECKSUM=SS:SORT.MAC+SRT???.MAC+FORSRT.MAC
!
!  CREATE V/M STAND-ALONE SORT.
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*FSORT,FSORT/C=FSORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FSORT.LZT=FSORT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
.R MACRO
*COPYRT=COPYRT
*FSORT=FSORT.VER,SRTPRM,SRTSTA,SRTSCN,SRTUUO,SRTCMP,SRTFLT,SORT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
.R LINK
*FSORT.MAP/MAP=FSORT,-
*SYS:SCAN/SEGMENT:HIGH,-
*REL:HELPER/G
.IF (ERROR) .GOTO TRUBLE
.SSAVE FSORT
.IF (ERROR) .GOTO TRUBLE
!
!  ASSEMBLE FORSRT
!
.ERROR %
.DIR LISTEM.MAC
.IF (ERROR) .GOTO NOLIST	!CREF NOT WANTED
!
.ERROR
.R MACRO
*COPYRT=COPYRT
*FORSRT,FORSRT/C=FORSRT
.IF (ERROR) .GOTO TRUBLE
!
!  CREATE LISTINGS.
!
.R CREF
*DSK:COPYRT.LZT=COPYRT
*DSK:FORSRT.LZT=FORSRT
.IF (ERROR) .GOTO TRUBLE
.GOTO DONCRF
!
NOLIST::
.ERROR
!
.R MACRO
*COPYRT=COPYRT
*FORSRT=FORSRT
.IF (ERROR) .GOTO TRUBLE
!
DONCRF::
!
!  TEST TO SEE IF FORTRAN SORT REQUIRED.
!
.ERROR %
.DIR FORLIB.REL
.IF (ERROR) .GOTO FINISH !NOT REQUIRED
.ERROR
!
!  PLACE INTO FORLIB.REL.
!  SEE IF WE HAVE ORIGINAL FORLIB OR A SORT MODIFIED ONE.
!
.R MAKLIB
*SRTFOO=FORLIB/EXTRACT:SORT
.IF (NOERROR) .GOTO REPLAC
!
!  ORIGINAL FORLIB--PUT SORT AT THE END.
!
.R MAKLIB
*FORLIB=FORLIB,FORSRT/APPEND
.IF (ERROR) .GOTO TRUBLE
.GOTO INDEX
!
REPLAC::
!
!  JUST REPLACE SORT MODULE.
!
.R MAKLIB
*FORLIB=FORLIB/MASTER:SORT,FORSRT/REPLACE:SORT
.DELETE SRTFOO.REL
.IF (ERROR)!
!
INDEX::
!
!  INDEX FORLIB.REL.
!
.R MAKLIB
*FORLIB=FORLIB/INDEX
.IF (ERROR) .GOTO TRUBLE
!
!  DELETE UNNEEDED FILES.
!
.DELETE FSORT.REL,FORSRT.REL
.IF (ERROR)!
!
.GOTO FINISH
TRUBLE::.PLEASE -- V/M FORTRAN SORT CREATION UNSUCCESSFUL.^[
.GOTO FAIL
FINISH::
!
!TEST FOR WHICH SYSTEM
@GOTO TOPS20	!TOPS20 VERSION
.GOTO TOPS10	!TOPS10 VERSION
!
TOPS20::
@CHKPNT FINISH::
!SET UP THE DEFAULTS
!
@ERROR
@TAKE SORT.CMD
@IF (ERROR) !IGNORE IT
!
!  SEE WHAT WE GOT.
!
@VD SORT.*,SRTCBL.REL,FORSRT.REL,FORLIB.REL,
@CHECK SEQ
@
!
@VD COBOL-68-BUILD:LIBOL.REL,COBOL-68-BUILD:LIBO*.EXE,
@CHECK SEQ
@
!
@VD COBOL-74-BUILD:C74O*.EXE,COBOL-74-BUILD:C74O*.REL,
@CHECK SEQ
@
!
!  TELL OPERATOR HOW WE DID.
!
@PLEASE -- SORT CREATION SUCCESSFUL
@!GET TO MONITOR LEVEL
@GOTO OK


TOPS10::
.CHKPNT FINISH::
.ERROR
!SET UP THE DEFAULT LOGICAL NAMES
!
.DO SORT.MIC
.IF (ERROR) !IGNORE IT
!
!
!  SEE WHAT WE GOT.
!
.R DIRECT
*TTY:/CHECKSUM=SORT.*+LIBOL.REL+LIBO??.EXE+FORLIB.REL+C74???.*+FSORT.EXE
!
!  TELL OPERATOR HOW WE DID.
!
.PLEASE -- SORT CREATION SUCCESSFUL.^[
.!GET TO MONITOR LEVEL
.GOTO OK
FAIL::
OK::!END OF SORT.CTL