Spooler Programmer's Guide
Sample Print Process
Spooler Programmer’s Guide—522287-002
A-6
! *===================================================================*
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! procedure name: BUILD^HEADER
! parameters: none
! description: This procedure builds the job page banner, which in 
! general is entirely application-defined. The page banner 
! printed by this sample process is:
!
! ********************************************
! * *
! * DATE: today's date *
! * TIME: current time *
! * JOB NUMBER: spooler job number *
! * LOCATION NAME: spooler location name *
! * REPORTNAME: name of report *
! * FORM NAME: name of form *
! * *
! ********************************************
!
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROC build^header;
 BEGIN
 INT i,
 error;
 STRING .locations := @dev.locationname '<<' 1,
 .formnames := @dev.formname '<<' 1,
 .reportnames := @dev.reportname '<<' 1;
 STRING months [0:35] = 'P' :=
 "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
 STRING .ptr;
!---Beginning of code--------------------------------------------------
 FOR i := 0 to 14 DO
 BEGIN
 header[i].line := " ";
 header[i].line[1] ':=' header[i].line FOR 59;
 END;
! Load the header array
 IF header^index = 2 THEN
 BEGIN
 @ptr := @header[0].line '<<' 1;
 ptr[20] := "*";
 ptr[21] ':=' ptr[20] FOR 60;
 error := writefile (dev^fnum,header[0].line,60);
 IF error THEN
 CALL ABEND;
 header^index := header^index + 1;
 RETURN;
 END;
 IF header^index = 3 THEN
 BEGIN
 @ptr := @header[1].line '<<' 1;
 ptr[20] := ptr[80] := "*";
 CALL TIME (time^array );
 error := writefile (dev^fnum,header[1].line,60);
 IF error THEN
 CALL ABEND;
 header^index := header^index + 1;
 RETURN;
 END;
 IF header^index = 4 THEN
 BEGIN
 @ptr := @header[2].line '<<' 1;










