1 !******************************************************************** & ! & ! & ! M11HDR & ! & ! Create the Header Record for a New Mailing List File & ! & ! & !******************************************************************** & ! 3 ! Program : M11HDR & ! Version : 1 11-Aug-82 & ! Programmer : Don Gohn & ! Releaser : Jean Fullerton & ! & ! 11 !-------------------------------------------------------------------- & ! & ! Copyright & ! 100 !-------------------------------------------------------------------- & ! & ! Summary & ! & ! & ! This program writes the header record to a new Mailing List file & ! which was created by RMSDEF as a result of the SMAILU program. & ! & ! Assumption: This program runs from an ATPK command file which & ! contains the answers for the two questions asked. & ! 200 !-------------------------------------------------------------------- & ! & ! Interfaces & ! & ! COMERR - Common Error buffer & ! MAPMLF - Address record buffer & ! MAPHDR - Mail file header buffer & ! & ! 300 !-------------------------------------------------------------------- & ! & ! Input / Output & ! & ! & ! & ! Channel File Name MAP Name Status at entry/exit & ! ------- --------- -------- -------------------- & ! CH.ADD% FILE.NAME$ MAPMLF CLOSED/CLOSED & ! CH.KB% "KB:" CLOSED/CLOSED & ! CH.HDR% HDR.FILE$ BUF CLOSED/CLOSED & ! 400 !-------------------------------------------------------------------- & ! & ! & ! Variable and Array Definitions & ! & ! C Used to set CNTRL C trapping & ! CH.ADD% Mailing list file channel & ! CH.HDR% Temporary header file channel & ! CH.KB% Keyboard channel & ! CNTRL.C% System error code for Control C & ! ERL Line in which error occurred & ! ERR Set to error after error & ! FATAL.ERROR% Smart Mailer error code for fatal error & ! FILE.NAME$ Name of Mail file & ! HDR.FILE$ Name of temporary header file & ! 600 !-------------------------------------------------------------------- & ! & ! & ! C O M M O N D E C L A R A T I O N S & ! & ! & !******************************************************************** & & 650 !-------------------------------------------------------------------- & ! & ! & ! M A P S T A T E M E N T S & ! & ! & !******************************************************************** & 690 MAP (BUF) BUFFER$ = 512% ! Map for temporary header & ! file. & 700 !-------------------------------------------------------------------- & ! & ! Subprograms & ! & ! none & ! & !-------------------------------------------------------------------- & ! & ! Subroutines & ! & ! none & ! & !-------------------------------------------------------------------- & ! & ! Functions & ! & ! none & ! & !-------------------------------------------------------------------- & 1000 !******************************************************************** & ! & ! & ! S T A R T P R O G R A M L O G I C & ! & ! & !******************************************************************** & 1020 ON ERROR GOTO 19000 & \ ERR.PROGNAM$ = "M11HDR VER:00" & \ ERR.CALLNAM$ = "M11HDR VER:00" & \ ERR.SUBNAM$ = "" & \ ERR.MSG$ = "Unexpected fatal error" & \ C = CTRLC & \ WAIT 0% & \ CH.KB% = 1% & \ CH.ADD% = 2% ! Mailing list file & \ CH.HDR% = 3% & \ CNTRL.C% = 28% ! ASCII value for control C & \ FATAL.ERROR% = -1% ! Code for a fatal error & ! Set standard error trap. Set up common for error reporting. & ! Set constants. Open keyboard. & 1040 OPEN "KB:" AS FILE #CH.KB% & \ INPUT LINE #CH.KB%, FILE.NAME$ & \ INPUT LINE #CH.KB%, HDR.FILE$ & \ CLOSE CH.KB% & ! Open keyboard. & ! Read in (from the ATPK command file) the name of the new data file & ! just created and the name of the temporary file which stores the & ! header record. & 1060 OPEN FILE.NAME$ FOR INPUT AS FILE #CH.ADD% & ,ORGANIZATION INDEXED VARIABLE & ,ACCESS MODIFY & ,ALLOW NONE & ,MAP MAPMLF & \ OPEN HDR.FILE$ FOR INPUT AS FILE #CH.HDR% & ,ACCESS READ & ,MAP BUF & \ GET #CH.HDR%, RECORD 1% & \ LSET HDR.ALL$ = BUFFER$ & \ MLF.ALL$ = HDR.ALL$ & \ PUT #CH.ADD% & \ CLOSE #CH.ADD% & \ CLOSE #CH.HDR% & \ KILL HDR.FILE$ & ! Open the Mailing List file. Open the Header temp file. Read the & ! header record from the temp file. Put the header record into the & ! Mail file. Close the Mail file and the header file. Delete the & ! header file. That's all folks! & & 9000 !*************************************************************** & ! & ! & ! E N D O F P R O C E S S I N G & ! & ! & !*************************************************************** & 9990 GO TO 32767 & ! Jump around the junk and leave. & 19000 !*************************************************************** & ! & ! & ! S T A N D A R D E R R O R H A N D L I N G & ! & ! & !*************************************************************** & 19020 RESUME 9000 IF ERR = CNTRL.C% ! CNTRL C trap & 19900 ERR.ERL% = ERL & \ ERR.ERR% = ERR & \ ERR.CODE% = FATAL.ERROR% & \ ERR.MSG$ = "Unexpected fatal error" & \ PRINT ERR.MSG$;CR;LF;ERT$(ERR); " at line ";ERL;" of ";ERN$ & \ RESUME 32767 & ! Print error message and quit. & 32767 END