1 SUB M11PAK (REC$) & 2 !******************************************************************** & ! & ! & ! M11PAK & ! & ! Packs the fields in an address records using delimiters & ! & ! & !******************************************************************** & ! 3 ! Subprogram : M11PAK (REC$) & ! Version : 1 8-Jan-82 & ! Programmer : John Montrym & ! Releaser : Jean Fullerton & ! & ! & ! 11 !-------------------------------------------------------------------- & ! & ! & ! C O P Y R I G H T & ! & ! & ! & ! (C) Copyright 1982 & ! Digital Equipment Corporation, Maynard, Massachusetts & ! & ! This software is furnished under a license for use only & ! on a single computer system and may be copied only with & ! the inclusion of the above copyright notice. This & ! software, or any other copies thereof, may not be pro- & ! vided or otherwise made available to any other person & ! except for use of such system and to one who agrees to & ! these license terms. Title to and ownership of the & ! software shall at all times remain in DIGITAL. & ! & ! The information in this software is subject to change & ! without notice and should not be construed as a commit- & ! ment by Digital Equipment Corporation. & ! & ! DIGITAL assumes no responsibility for the use or relia- & ! bility of its software on equipment that is not sup- & ! plied by DIGITAL. & ! 20 !********************************************************************** ! ! ! MODIFICATION HISTORY ! ! !********************************************************************* ! ! VER DATE BY ! 1.1 14-Jun-84 Mike Brown ! added lin1 1110 to allow fixed length fields. ! 100 !-------------------------------------------------------------------- & ! & ! & ! Summary & ! & ! This subprogram packs the data from the mailing list & ! record contained in MAPADD into the variable REC$ for writing & ! to a mailing list file. & ! & ! Calling modules: Any module which needs to pack an address & ! record for writing to a mailing list file. & ! & !-------------------------------------------------------------------- 200 ! & ! & ! Interfaces & ! & ! Common areas: & ! & ! COMERR - Error conditions variables & ! COMCON - System constants & ! & ! MAPADD - Map of the address record & ! & ! & ! Arguments: & ! & ! REC$ - (output) packed record for writing to the file & ! & !--------------------------------------------------------------------- 300 ! & ! & ! Input / Output & ! & ! & ! Channel Filename Map name Status at entry/exit & ! ------- --------- -------- -------------------- & ! & ! none & ! 400 !-------------------------------------------------------------------- & ! & ! Variable and Array Definitions & ! & ! & ! & ! ERL Line in which error occurred & ! ERR Set to error number after error & ! & ! 600 !-------------------------------------------------------------------- & ! & ! & ! COMMON Declarations & ! & ! & !-------------------------------------------------------------------- 650 !-------------------------------------------------------------------- & ! & ! & ! MAP Statements & ! & ! & !--------------------------------------------------------------------- 700 ! & ! & ! Subprograms & ! & ! & ! none & ! & !-------------------------------------------------------------------- & ! 800 ! Subroutines & ! & ! none & ! & !-------------------------------------------------------------------- & ! & ! Functions & ! & ! none & ! 1000 !*************************************************************** & ! & ! & ! S T A R T S U B P R O G R A M L O G I C & ! & ! & !**************************************************************** & 1010 ON ERROR GOTO 19000 & \ ERR.SUBNAM$ = "M11PAK VER:01" ! Set up our name. & ! Set standard error trap. Set up COMMON for error reporting. & & 1110 IF HDR.PACK.ADDRS$ = "N" THEN REC$ = ADD.CVF.1$ + ADD.CVF.2$ GOTO 9000 END IF ! Don't pack if file uses fixed length fields. ! REC$ contains everything in the ADD buffer except ADD.FUTURE$. ! Because of a better record/buffer fit, this reduces the size of ! the 'fixed length' file by 50%. 1120 REC$ = ADD.PRIME.ID$ + & ADD.ALTERNATE.ID$ + & ADD.COUNTER$ & ! Set up the fixed fields. & 1190 DELIM$ = CHR$(31%) 1200 REC$ = REC$ + EDIT$ (ADD.ZIP$, 140%) + & DELIM$ + EDIT$ (ADD.STATE$, 140%) + & DELIM$ + EDIT$ (ADD.CAT1$, 140%) + & DELIM$ + EDIT$ (ADD.CAT2$, 140%) + & DELIM$ + EDIT$ (ADD.CAT3$, 140%) + & DELIM$ + EDIT$ (ADD.CAT4$, 140%) + & DELIM$ + EDIT$ (ADD.CAT5$, 140%) + & DELIM$ + EDIT$ (ADD.CAT6$, 140%) + & DELIM$ + EDIT$ (ADD.NAME$, 140%) + & DELIM$ + EDIT$ (ADD.CITY$, 140%) + & DELIM$ + EDIT$ (ADD.ADDR1$, 140%) + & DELIM$ + EDIT$ (ADD.ADDR2$, 140%) + & DELIM$ + EDIT$ (ADD.ADDR3$, 140%) + & DELIM$ + EDIT$ (ADD.FUTURE$, 140%) + & DELIM$ + EDIT$ (ADD.COMMENT$, 140%) & ! Tack on the variable portions and their delimiters. & & 9000 !*************************************************************** & ! & ! & ! E N D O F P R O C E S S I N G & ! & ! & !*************************************************************** & 9900 ERR.SUBNAM$ = "" & \ GO TO 32767 & ! Go to the end of the subprogram. & 19000 !*************************************************************** & ! & ! & ! S T A N D A R D E R R O R H A N D L I N G & ! & ! & !*************************************************************** & & 19900 ERR.ERL% = ERL & \ ERR.ERR% = ERR & \ ERR.CODE% = FATAL.ERROR% & \ ON ERROR GO BACK & ! On a fatal error, call the standard error handler, & ! then go back to the calling program. & & 32767 SUBEND