//**** START OF SPECIFICATIONS *****************************************00010000 //* *00020000 //* MODULE NAME = APSUC02 *00030000 //* *00040000 //* $MOD(APSUC02 ) COMP(APS) PROD(PSF) : VERSION 3.3.0 *00050000 //* *00060000 //* DESCRIPTIVE NAME = Installation exit job trailer routine *00070000 //* *00080000 //* STATUS = VERSION 3, RELEASE 3, LEVEL 0 *00090000 //* *00100000 //* FUNCTION = Defines a job trailer separator page with the *00110000 //* JOBNAME in block letters and followed by job *00120000 //* related information lines. *00130000 //* *00140000 //* This job trailer exit contains the code *00150000 //* to not transmit this trailer page (branches *00160000 //* around the exit code) if connected to DPF *00170000 //* (Distributed Print Facility). Trailers are *00180000 //* required to be active when connected to DPF *00190000 //* so that PSF can inform DPF of the job *00200000 //* boundaries. *00210000 //* *00220000 //* TRAILER SHEET *00230000 //* *00240000 //* This trailer sheet provides 6 additional keywords, when *00250000 //* compared to the original assembler trailer sheet. *00260000 //* They are: *00270000 //* TITLE: *00280000 //* NAME: *00290000 //* ROOM: *00300000 //* BUILDING: *00310000 //* DEPARTMENT: *00320000 //* ADDRESS: *00330000 //* *00340000 //* The 6 keywords are obtained from the Print Dataset's *00350000 //* OUTPUT JCL. *00360000 //* *00370000 //* A SEGMENT ID field may or may not be printed on *00380000 //* the same line as the JOBID on the trailer sheet. *00390000 //* If the SYSOUT is not segmented, then the entire *00400000 //* SEGMENT ID field is omitted from the trailer sheet. *00410000 //* For segmented SYSOUT, the SEGMENT ID is formatted *00420000 //* and printed on the trailer sheet. If the segment ID is *00430000 //* negative or greater than 99999, then the SEGMENT ID field *00440000 //* is printed as ***** (indicates an invalid segment ID). *00450000 //* *00460000 //* The OUTPUT JCL (SWBTU) is the preferred source for NAME *00470000 //* and ROOM. The JCL values (6 new keywords) are *00480000 //* retrieved via the SWBTUREQ macro. If *00490000 //* NAME is not in the SWBTU, then the programmer name from the *00500000 //* JSPA is used. Likewise, if ROOM is not in the SWBTU, then *00510000 //* the room from the JSPA (Job Stmt) is used. *00520000 //* *00530000 //* The ADDRESS keyword allows the address to be from 1 to 4 *00540000 //* lines long. Any lines that are unused are printed as blank *00550000 //* lines, but the label ADDRESS appears on the first line even *00560000 //* if no address was specified on the OUTPUT JCL. *00570000 //* *00580000 //* If the SWBTUREQ macro returned an error, the ADDRESS line *00590000 //* is not printed. An error message is printed in the four *00600000 //* lines that would have contained the ADDRESS that contains *00610000 //* the SWBTUREQ Return Code and Reason Code. *00620000 //* *00630000 //* DESTINATION is a new field on the trailer sheet. Its value 00640000 //* is obtained from the JSPA. *00650000 //* *00660000 //* *00670000 //* *00680000 //* OPERATION = The following items are done by this exit: *00690000 //* 1. Create 12 block letter line records for *00700000 //* the job name. *00710000 //* 2. Pass the block letter lines to PSF. *00720000 //* 3. Build Job Information Lines. *00730000 //* 4. Pass the information line record to PSF. *00740000 //* *00750000 //* NOTES = *00760000 //* APSUPUTC and APSUBLKC are assembler routines which put *00770000 //* values into registers, and call the PLX routines APSUPUT *00780000 //* and APSUBLK. The address of these 2 routines can be found *00790000 //* in (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC and *00800000 //* (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC. *00810000 //* Each of these routines accepts 2 parameters : the address *00820000 //* of APSGEXTP (xtpptr), and a return code. *00830000 //* *00840000 //* APSUBLK is called with the data to be expanded in ECABLKIN. *00850000 //* It puts the expanded block letters into ECAWKBUF, beginning *00860000 //* with the second byte. *00870000 //* APSUPUT is called with the records to be passed to PSF for *00880000 //* printing pointed to by ECARECAD. *00890000 //* *00900000 //* APSUMACC is an assembler routine that puts values into *00910000 //* registers, and calls the SWBTUREQ macro. *00920000 //* *00930000 //* APSUTIMC is an assembler routine that issues the TIME SVC, *00940000 //* and converts the returned time and date. *00950000 //* *00960000 //* DEPENDENCIES = None *00970000 //* RESTRICTIONS = None *00980000 //* *00990000 //* MODULE TYPE = Procedure *01000000 //* PROCESSOR = C *01010000 //* ATTRIBUTES = Reentrant *01020000 //* AMODE 31 *01030000 //* RMODE ANY *01040000 //* *01050000 //* ENTRY POINT = APSUC02 *01060000 //* LINKAGE = *01070000 //* One parameter is passed - the address of APSGEXTC *01080000 //* *01090000 //* INPUT = *01100000 //* APSUSEPC - Separator exits header file *01110000 //* APSGEXTC - PSF Installation Exit Parameter Area *01120000 //* APSUECAC - PSF Exit Communications Area *01130000 //* APSUJSPC - JOB Separator Page Area *01140000 //* APSUJMRC - MVS Job Management Record *01150000 //* APSUJESC - Job Entry Subsystem Communication Table *01160000 //* APSUSJTC - Scheduler JCL Facility SWBTUREQ RETRIEVE *01170000 //* Parameter List *01180000 //* APSUDOTC - Dynamic Output Text Unit Mappings *01190000 //* APSUDOKC - Dynamic Output Key Mapping *01200000 //* APSUSJCC - Scheduler JCL Facility (SJF) SWBTUREQ *01210000 //* Services Return and Reason Codes *01220000 //* *01230000 //* OUTPUT = *01240000 //* Line data records *01250000 //* *01260000 //* EXIT NORMAL = Return to caller *01270000 //* *01280000 //* EXIT ERROR = None *01290000 //* *01300000 //* EXTERNAL REFERENCES = *01310000 //* ROUTINES = *01320000 //* APSUBLKC - Build block letter records *01330000 //* APSUPUTC - Put record to PSF *01340000 //* APSUMACC - Call SWBTUREQ macro *01350000 //* APSUTIMC - Issue TIME SVC *01360000 //* DATA AREAS = *01370000 //* APSUSEPC - Separator exits header file *01380000 //* APSGEXTC - PSF Installation Exit Parameter Area *01390000 //* APSUECAC - PSF Exit Communications Area *01400000 //* APSUJSPC - JES Separator Page Area *01410000 //* APSUJMRC - MVS Job Management Record *01420000 //* APSUJESC - Job Entry Subsystem Communication Table *01430000 //* APSUSJTC - Scheduler JCL Facility SWBTUREQ RETRIEVE *01440000 //* Parameter List *01450000 //* APSUDOTC - Dynamic Output Text Unit Mappings *01460000 //* APSUDOKC - Dynamic Output Key Mapping *01470000 //* APSUSJCC - Scheduler JCL Facility (SJF) SWBTUREQ *01480000 //* Services Return and Reason Codes *01490000 //* *01500000 //* MACROS = None *01510000 //* *01520000 //* MESSAGES = None *01530000 //* *01540000 //* CHANGE ACTIVITY = *01550000 //* *01560000 //* $B0=OW45952, HPRF320, 000829, BDKUEAS: Initial Version @B0A*01570000 //* $01=OW46503, HPRF320, 010328, BDKURLF: Fix bitwise negation @01A*01580000 //* $EV=LAPS0009,HPRF330,010530,BUQ4RLB: Version 3.3.0 @EVA*01590000 //**** END OF SPECIFICATIONS *******************************************01600000 01610000 #pragma comment(date) 01620000 #pragma csect(CODE,"$APSUC02") 01630000 #pragma csect(STATIC,"#APSUC02") 01640000 #pragma linkage(APSUC02,OS) 01650000 #pragma runopts(TRAP(OFF)) 01660000 #pragma map(apsuc02,"APSUC02") 01670000 #pragma linkage(CLRLINE,OS) 01680000 #pragma map(clrline,"CLRLINE") 01690000 01700000 #pragma linkage(APSUMACC,OS) 01710000 #pragma linkage(APSUTIMC,OS) 01720000 01730000 /*--------------------------------------------------------------------- 01740000 #include these header files for structure & function definitions: 01750000 ---------------------------------------------------------------------*/ 01760000 01770000 #include "apsgextc.h" 01780000 #include "apsuecac.h" 01790000 #include "apsujspc.h" 01800000 #include "apsujmrc.h" 01810000 #include "apsujesc.h" 01820000 #include "apsusjtc.h" 01830000 #include "apsusjcc.h" 01840000 #include "apsudotc.h" 01850000 #include "apsudokc.h" 01860000 #include "apsusepc.h" 01870000 #include "apsusep.h" 01880000 01890000 /*--------------------------------------------------------------------- 01900000 Used to build/print address lines 01910000 ---------------------------------------------------------------------*/ 01920000 01930000 short int wrkadnum; // Number of address lines present 01940000 01950000 short int unusedlns; // Number of unused address lines 01960000 // Used for loop that builds/prints 01970000 // blank address lines 01980000 short int addrloop; // Used for loop that builds/prints 01990000 // address lines 02000000 DOCNTENT * tempdocptr; // Used for prnting mult address lines 02010000 02020000 /*--------------------------------------------------------------------- 02030000 Used to get time and date, and build/print time and date lines 02040000 ---------------------------------------------------------------------*/ 02050000 02060000 DTTM_MAPPING dateandtime; // Holds date and time, so that fields 02070000 // may be picked out easily 02080000 02090000 /*--------------------------------------------------------------------- 02100000 Used to build/print JOB ID and OUTPUT GROUP lines 02110000 ---------------------------------------------------------------------*/ 02120000 02130000 unsigned char dblwordÝ8¨; // Holds EBCDIC conversion - used to 02140000 // keep zeroes which are used to pad 02150000 02160000 /*------------------------------------------------------------- 02170000 SWBTUREQ parameters and work areas 02180000 --------------------------------------------------------------*/ 02190000 02200000 SJTRP sjtrp; // SWBTUREQ input parameter area 02210000 02220000 unsigned char swbtuwsÝ1024¨; // SWBTUREQ Work Area 02230000 02240000 unsigned char sbtlareaÝ16¨; // SJTRSBTL Area 02250000 02260000 unsigned char keylistÝ64¨; // SJTRKEYL Area 02270000 02280000 unsigned char swberr; // SWBTUREQ error = "Y" 02290000 02300000 int swbtu_rtncode; // Return code from SWBTUREQ 02310000 02320000 int swbrc; // Return code from SWBTUREQ 02330000 02340000 int swbrs; // Reason code from SWBTUREQ 02350000 02360000 /*--------------------------------------------------------------------- 02370000 Miscellaneous Declarations 02380000 ---------------------------------------------------------------------*/ 02390000 02400000 BUFWRK * ecawkptr; // ECA work buf pointer 02410000 02420000 JSPEXT * jspextptr; // Pointer to JSPA extension 02430000 02440000 int rtncode; // Return code from APSUPUT, APSUBLK, 02450000 // and SWBTUREQ 02460000 SJTRKEYL * wrkkylst; // Keylist address (SJTRKEYL) 02470000 SJTRKEYL * tempwrkkylst; // Temp Keylist address used to fill in02480000 // each key 02490000 02500000 /*--------------------------------------------------------------------- 02510000 APSUC02 Main Function 02520000 ---------------------------------------------------------------------*/ 02530000 02540000 void apsuc02(APSGEXTP * xtpptr) 02550000 { 02560000 rtncode = swbtu_rtncode = swbrc = swbrs = 0; 02570000 02580000 /*------------------------------------------------------------- 02590000 Suppress the trailer when attached to the distributed print 02600000 function of PSF/2 02610000 --------------------------------------------------------------*/ 02620000 if (!(xtpptr->XTPECAP->ECABASE.ECAECEP->ECEFLAG & ECEDPF)) 02630000 // DPF attached printer? 02640000 { // Not DPF 02650000 xtpptr->XTPECAP->ECABASE.ECAFLAGS &= 0x00; 02660000 // Reset ECAFLAGS 02670000 xtpptr->XTPECAP->ECABASE.ECAFLAGS &= ~ECALJUST; 02680000 // Reset left adjust flag @01C 02690000 xtpptr->XTPECAP->ECABASE.ECADRF = 0x00; 02700000 // Reset record type flags 02710000 xtpptr->XTPECAP->ECABASE.ECADRF |= ECALMR | ECAMACH; 02720000 // Set line mode and machine code flags02730000 xtpptr->XTPECAP->ECABASE.ECARECLN = 1; 02740000 // Get length of record 02750000 ecawkptr = (BUFWRK *)&(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 02760000 // Get address of ECA work area, and 02770000 // map with BUFWRK structure 02780000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02790000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 02800000 // Get record address 02810000 02820000 /*********************************************************************02830000 Print the job name in straight block letters 02840000 ********************************************************************/02850000 02860000 memcpy(xtpptr->XTPECAP->ECABASE.ECABLKIN, 02870000 xtpptr->XTPJSPAP->JSPAJBNM,STRING_LEN); 02880000 // Obtain job name 02890000 xtpptr->XTPECAP->ECABASE.ECAFLAGS &= ~ECASLANT; 02900000 // Turn off slant indicator @01C 02910000 02920000 // Call APSUBLK 02930000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC; 02940000 // Get address of APSUBLKC 02950000 AsmFunc(xtpptr, &rtncode); // Call APSUBLKC 02960000 xtpptr->XTPECAP->ECABASE.ECARECLN = LINELGTH; 02970000 // Set length of the block letter 02980000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02990000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 03000000 // Set address of record 03010000 ecawkptr->wrkcc = 0x09; // Set CC in print record to write 03020000 if (rtncode == 0) // If rc==0 from APSUBLK 03030000 // Call APSUPUT to print step name 03040000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 03050000 xtpptr->XTPECAP->ECABASE.ECAGWRK <= BLOCK_LEN; 03060000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 03070000 { 03080000 // Call APSUPUT 03090000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 03100000 // Get address of APSUPUTC 03110000 AsmFunc(xtpptr, &rtncode); 03120000 // Call APSUPUTC 03130000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03140000 (ECABUFPTR)((byte *)xtpptr->XTPECAP->ECABASE.ECARECAD + 03150000 PRINTLINE_LEN); 03160000 // Get next record to print 03170000 ecawkptr->wrkcc = 0x09; // Set CC to write 03180000 if (rtncode != 0) break; 03190000 } 03200000 if (rtncode == 0) // If rc==0 from APSUPUT of JOBNAME 03210000 { 03220000 /************************************************************* 03230000 Provide 3 blank lines between block letter groups 03240000 *************************************************************/ 03250000 03260000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03270000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 03280000 // Set record address back to beginning03290000 // of work buffer 03300000 xtpptr->XTPECAP->ECABASE.ECARECLN = 2; 03310000 // Get length of record 03320000 ecawkptr->wrkcc = 0x09; // Set CC to write 03330000 ecawkptr->printpos = BLANK; 03340000 // Set print position to blank 03350000 // Call APSUPUT to print 3 blank lines 03360000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 03370000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=3; 03380000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 03390000 { 03400000 // Call APSUPUT 03410000 AsmFunc = (void (*)()) 03420000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 03430000 // Get address of APSUPUTC 03440000 AsmFunc(xtpptr, &rtncode); 03450000 // Call APSUPUTC 03460000 if (rtncode != 0) break; 03470000 } // End for loop 03480000 } // End print 3 blank lines 03490000 03500000 if (rtncode == 0) // If rc==0 from APSUPUT of 3 blank lns03510000 { 03520000 /**************************************************************** 03530000 Print the job ID in straight block letters 03540000 ****************************************************************/ 03550000 03560000 memcpy(xtpptr->XTPECAP->ECABASE.ECABLKIN, 03570000 xtpptr->XTPJSPAP->JSPAJBID,STRING_LEN); 03580000 // Obtain job name 03590000 xtpptr->XTPECAP->ECABASE.ECAFLAGS &= ~ECASLANT; 03600000 // Turn off slant indicator @01C 03610000 03620000 // Call APSUBLK 03630000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC; 03640000 // Get address of APSUBLKC 03650000 AsmFunc(xtpptr, &rtncode); // Call APSUBLKC 03660000 xtpptr->XTPECAP->ECABASE.ECARECLN = LINELGTH; 03670000 // Set length of the block letter 03680000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03690000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 03700000 // Set address of record 03710000 ecawkptr->wrkcc = 0x09; // Set CC in print record to write 03720000 } // End APSUBLK for JOB ID 03730000 03740000 if (rtncode == 0) // If rc==0 from APSUBLK 03750000 // Call APSUPUT to print step name 03760000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 03770000 xtpptr->XTPECAP->ECABASE.ECAGWRK <= BLOCK_LEN; 03780000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 03790000 { 03800000 // Call APSUPUT 03810000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC;03820000 // Get address of APSUPUTC 03830000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 03840000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03850000 (ECABUFPTR)((byte *)xtpptr->XTPECAP->ECABASE.ECARECAD + 03860000 PRINTLINE_LEN); 03870000 // Get next record to print 03880000 ecawkptr->wrkcc = 0x09; // Set CC to write 03890000 if (rtncode != 0) break; 03900000 } 03910000 if (rtncode == 0) // If rc==0 from APSUPUT 03920000 { 03930000 /************************************************************* 03940000 Provide 3 blank lines between block letter groups 03950000 *************************************************************/ 03960000 03970000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03980000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 03990000 // Set record address back to beginning04000000 // of work buffer 04010000 xtpptr->XTPECAP->ECABASE.ECARECLN = 2; 04020000 // Get length of record 04030000 ecawkptr->wrkcc = 0x09; // Set CC to write 04040000 ecawkptr->printpos = BLANK; 04050000 // Set print position to blank 04060000 // Call APSUPUT to print 3 blank lines 04070000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 04080000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=3; 04090000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 04100000 { 04110000 // Call APSUPUT 04120000 AsmFunc = (void (*)()) 04130000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 04140000 // Get address of APSUPUTC 04150000 AsmFunc(xtpptr, &rtncode); 04160000 // Call APSUPUTC 04170000 if (rtncode != 0) break; 04180000 } 04190000 } // End print 3 blank lines 04200000 04210000 /********************************************************** 04220000 Begin building the main print line 04230000 **********************************************************/ 04240000 04250000 /********************************************************** 04260000 * Build the detail box and print it on the separator * 04270000 * page. * 04280000 * Addressability to the ECA buffer work area is * 04290000 * established and the routine CLRLINE is called to * 04300000 * clear the separator page line buffer. * 04310000 * CLRLINE is called for each subsequent line to clear * 04320000 * that line and reset the buffer work space pointer. * 04330000 * The detail box information is then filled into the * 04340000 * line buffer and APSUPUT is invoked to print the line. * 04350000 * The following ESS JCL keywords will be retrieved and * 04360000 * placed on the separator page: * 04370000 * * BUILDING * 04380000 * * DEPARTMENT * 04390000 * * TITLE * 04400000 * * ROOM * 04410000 * * NAME * 04420000 * The keywords are retrieved using the Scheduler JCL * 04430000 * Facility SWBTUREQ macro. * 04440000 * The separator page is formatted as a detail box. * 04450000 * * 04460000 * Storage located in the area pointed to by ECEWKPTR: * 04470000 * * SWBTUREQ OUTPUT AREA * 04480000 ***********************************************************/ 04490000 04500000 if (rtncode == 0) 04510000 { 04520000 memset(ecawkptr, BLANK, PRINTLINE_LEN); 04530000 // Set print line to blanks 04540000 04550000 /*********************************************************** 04560000 * * 04570000 * Fill in the SWBTUREQ RETRIEVE parameter list, sjtrp. * 04580000 * * 04590000 ***********************************************************/ 04600000 04610000 memset(&sjtrp, XZERO, SJTRLGTH); 04620000 // Clear sjtrp to zero 04630000 memcpy(sjtrp.SJTRID, SJTRCID, strlen(SJTRCID)); 04640000 // Assign function 04650000 sjtrp.SJTRVERS = SJTRCVER; // Assign version number 04660000 sjtrp.SJTRLEN = SJTRLGTH; // Set parameter list length 04670000 04680000 memset(&swbtuws, XZERO, 1024); 04690000 // Clear swbtuws to zero 04700000 sjtrp.SJTRSTOR = &swbtuws; // Set work area address - this is a 04710000 // 1K work area that is used as a 04720000 // work area by the SWBTUREQ macro 04730000 sjtrp.SJTRSTSZ = WORKAREA_LEN; 04740000 // Set work area length 04750000 sjtrp.SJTRSWBN = NUM_SWBTU_PTRS; 04760000 // Indicate only ONE SWBTU pointer 04770000 memset(&sbtlarea, XZERO, SW_ADDRLIST_LEN); 04780000 // Clear sbtlarea 04790000 sjtrp.SJTRSWBA = (SJTRSBTL *)&sbtlarea; 04800000 // Set SWBTU addr list address 04810000 // (SJTRSBTL) 04820000 memset(&keylist, XZERO, KEYLIST_LEN); 04830000 // Clear keylist 04840000 sjtrp.SJTRKIDN = NUM_KEYS; // Indicate number of keys in key list 04850000 sjtrp.SJTRKIDL = (SJTRKEYL *)&keylist; 04860000 // Set key list address 04870000 wrkkylst = (SJTRKEYL *)&keylist; 04880000 // Save keylist address locally, for 04890000 // easy reference 04900000 04910000 sjtrp.SJTRAREA = xtpptr->XTPECAP->ECABASE.ECAECEP->ECEWKPTR; 04920000 // Set output area address - this is 04930000 // 1K Text Unit Output Area that is 04940000 // getmained by PSF, where the 04950000 // parameters are returned by SWBTUREQ 04960000 sjtrp.SJTRSIZE = xtpptr->XTPECAP->ECABASE.ECAECEP->ECEWKLEN; 04970000 // Set output area length 04980000 04990000 /*********************************************************** 05000000 * Set the address of the area containing the SWBTU data 05010000 * from the JCL for the SWBTUREQ macro (obtained by PSF) 05020000 ***********************************************************/ 05030000 sjtrp.SJTRSWBA->SJTRSTUP = 05040000 xtpptr->XTPECAP->ECABASE.ECAECEP->ECETUPTR; 05050000 // Set input SWBTU ptr 05060000 05070000 /*********************************************************** 05080000 * * 05090000 * Insert the keys for all of the ESS parameters being * 05100000 * used into the key list. * 05110000 * * 05120000 ***********************************************************/ 05130000 tempwrkkylst = wrkkylst + KYLSTTL; 05140000 // Set temp ptr = beginning of wrkkylst05150000 tempwrkkylst->SJTRKYID = DOTITLE; 05160000 // Request TITLE key 05170000 tempwrkkylst = wrkkylst + KYLSTNM; 05180000 // Increment to NAME 05190000 tempwrkkylst->SJTRKYID = DONAME; 05200000 // Request NAME key 05210000 tempwrkkylst = wrkkylst + KYLSTRM; 05220000 // Increment to ROOM 05230000 tempwrkkylst->SJTRKYID = DOROOM; 05240000 // Request ROOM key 05250000 tempwrkkylst = wrkkylst + KYLSTBL; 05260000 // Increment to BUILDING 05270000 tempwrkkylst->SJTRKYID = DOBUILD; 05280000 // Request BUILDING key 05290000 tempwrkkylst = wrkkylst + KYLSTDP; 05300000 // Increment to DEPARTMENT 05310000 tempwrkkylst->SJTRKYID = DODEPT; 05320000 // Request DEPARTMENT key 05330000 tempwrkkylst = wrkkylst + KYLSTAD; 05340000 // Increment to ADDRESS 05350000 tempwrkkylst->SJTRKYID = DOADDRES; 05360000 // Request ADDRESS key 05370000 05380000 05390000 /*************************************************************** 05400000 * * 05410000 * Invoke the SWBTUREQ REQUEST=RETRIEVE Macro through APSUMACC * 05420000 * ----------------------------------------------------------- * 05430000 * Pass three parameters: * 05440000 * - A pointer to APSGEXTP * 05450000 * - A pointer to the SWBTUREQ parameter list, sjtrp * 05460000 * - A pointer to a return code * 05470000 * * 05480000 ***************************************************************/ 05490000 05500000 swberr = 'N'; // Initialize to no SWBTUREQ error 05510000 apsumacc(xtpptr, &sjtrp, &swbtu_rtncode); 05520000 rtncode = swbtu_rtncode; 05530000 } // End calling SWBTUREQ 05540000 if ((rtncode >= 4) // If a bad return code received 05550000 && (sjtrp.SJTRREAS != SJTRNOKY)) 05560000 // AND not true that no keys matched, 05570000 // which would indicate that none of 05580000 // the keywords were specified on the 05590000 // OUTPUT JCL 05600000 { 05610000 /********************************************************* 05620000 * * 05630000 * If the SWBTUREQ returns an error, the detail box is * 05640000 * still printed. An error message is printed on the * 05650000 * ADDRESS line. * 05660000 * NOTE: The PSF-supplied exits should not receive any * 05670000 * errors from the SWBTUREQ. This code is mainly * 05680000 * supplied for diagnostic purposes when changing * 05690000 * the exit. * 05700000 * * 05710000 *********************************************************/ 05720000 swbrc = rtncode; // Save return code 05730000 swbrs = sjtrp.SJTRREAS; // Save reason code 05740000 swberr = 'Y'; // Indicate a SWBTUREQ error occurred 05750000 // and a message is required 05760000 } // End bad retrieval 05770000 05780000 rtncode = 0; // Reset return code to 0, so that 05790000 // we'll continue printing trailer 05800000 // regardless of errors from SWBTUREQ 05810000 if (rtncode == 0) 05820000 { 05830000 /******************************************************* 05840000 Build and print top line 05850000 ******************************************************/ 05860000 clrline(xtpptr); 05870000 memcpy(&(ecawkptr->boxline), ENDTAG, strlen(ENDTAG)); 05880000 // Move in END tag 05890000 memcpy((byte *)(&(ecawkptr->boxline)) + strlen(ENDTAG), 05900000 &(ecawkptr->boxline), BOXLINE_LEN - strlen(ENDTAG)); 05910000 // Propogate chars for the rest of the 05920000 // length of boxline 05930000 // Call APSUPUT 05940000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 05950000 // Get address of APSUPUTC 05960000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 05970000 } // End good retrieval, print top line 05980000 if (rtncode == 0) 05990000 { 06000000 /****************************************************** 06010000 Build and print 2 blank lines 06020000 ******************************************************/ 06030000 clrline(xtpptr); 06040000 // Call APSUPUT to print 2 blank lines 06050000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 06060000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=2; 06070000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 06080000 { 06090000 // Call APSUPUT 06100000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC;06110000 // Get address of APSUPUTC 06120000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 06130000 if (rtncode != 0) break; 06140000 } 06150000 06160000 } // End print 2 blank lines 06170000 if (rtncode == 0) 06180000 { 06190000 /****************************************************** 06200000 Build and print JOB ID line 06210000 ******************************************************/ 06220000 clrline(xtpptr); 06230000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBJOBID, 06240000 strlen(LBJOBID)); 06250000 // Put JOB ID label 06260000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 06270000 xtpptr->XTPJSPAP->JSPAJBID, STRING_LEN); 06280000 // Put JOBID into box 06290000 if (xtpptr->XTPJSPAP->JSPAFLG1 & JSPA1EXT) 06300000 // Does JSPA ext. exist? 06310000 { 06320000 jspextptr = (JSPEXT *)(xtpptr->XTPJSPAP + 1); 06330000 // Get to JSPEXT by going to end of 06340000 // JSPA 06350000 if (jspextptr->JSPCESEG != XZERO) 06360000 // Is SYSOUT segmented? 06370000 { // Yes 06380000 memcpy(ecawkptr->boxline.boxlnseg.boxsglbl, LBSEGID, 06390000 strlen(LBSEGID)); 06400000 // Put SEGMENT ID label 06410000 if ((jspextptr->JSPCESEG >= 0) || 06420000 (jspextptr->JSPCESEG <= MAXSEGNUM)) 06430000 // Is SEGMENT# valid? 06440000 { // Yes 06450000 sprintf(dblword, "%.5i", jspextptr->JSPCESEG); 06460000 // Convert to EBCDIC 06470000 memcpy(ecawkptr->boxline.boxlnseg.boxsginf, dblword,5); 06480000 // Put SEGMENT# into box 06490000 } // End valid SEGMENT# 06500000 else // Invalid SEGMENT# 06510000 memcpy(ecawkptr->boxline.boxlnseg.boxsginf,"*****",5); 06520000 // Set invalid SEGMENT# 06530000 } // End SYSOUT segmented 06540000 } // End JSPA ext. exists 06550000 // Call APSUPUT 06560000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 06570000 // Get address of APSUPUTC 06580000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 06590000 } // End print JOB ID line 06600000 if (rtncode ==0) 06610000 { 06620000 /****************************************************** 06630000 Build and print JOB NAME line 06640000 ******************************************************/ 06650000 clrline(xtpptr); 06660000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBJOBNAM, 06670000 strlen(LBJOBNAM)); 06680000 // Put JOB NAME label 06690000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 06700000 xtpptr->XTPJSPAP->JSPAJBNM, STRING_LEN); 06710000 // Put JOBNAME into box 06720000 // Call APSUPUT 06730000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 06740000 // Get address of APSUPUTC 06750000 AsmFunc(xtpptr, &rtncode); 06760000 // Call APSUPUTC 06770000 } // End print JOB NAME line 06780000 if (rtncode ==0) 06790000 { 06800000 /****************************************************** 06810000 Build and print USER ID line 06820000 ******************************************************/ 06830000 clrline(xtpptr); 06840000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBUSERID, 06850000 strlen(LBUSERID)); 06860000 // Put USER NAME label 06870000 if (xtpptr->XTPJSPAP->JSPAFLG1 & JSPA1EXT) 06880000 // Does JSPA ext. exist? 06890000 { 06900000 jspextptr = (JSPEXT *)(xtpptr->XTPJSPAP + 1); 06910000 // Get to JSPEXT by going to end of 06920000 // JSPA 06930000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 06940000 jspextptr->JSPCEUID,STRING_LEN); 06950000 // Put USER NAME 06960000 } 06970000 // Call APSUPUT 06980000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 06990000 // Get address of APSUPUTC 07000000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 07010000 } // End print USER ID line 07020000 if (rtncode ==0) 07030000 { 07040000 07050000 /****************************************************** 07060000 Build and print SYSOUT CLASS line 07070000 ******************************************************/ 07080000 clrline(xtpptr); 07090000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBSYSCL, 07100000 strlen(LBSYSCL)); 07110000 // Put SYSOUT CLASS lbl 07120000 ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1Ý0¨ = 07130000 xtpptr->XTPJSPAP->JSPJSOCL; 07140000 // Put SYSOUT class 07150000 // Call APSUPUT 07160000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 07170000 // Get address of APSUPUTC 07180000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 07190000 } // End print SYSOUT CLASS line 07200000 if (rtncode ==0) 07210000 { 07220000 /****************************************************** 07230000 Build and print OUTPUT GROUP line 07240000 ******************************************************/ 07250000 clrline(xtpptr); 07260000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBOUTGRP, 07270000 strlen(LBOUTGRP)); // Put OUTPUT GROUP label 07280000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.outgrarea.boxjname, 07290000 xtpptr->XTPJSPAP->JSPJGRPN, STRING_LEN); 07300000 // Put OUTPUT GRP NODE1 07310000 ecawkptr->boxline.boxlnrel.boxinfo.outgrarea.boxgsep1 = '.'; 07320000 // Insert separator char 07330000 sprintf(dblword, "%.5i", xtpptr->XTPJSPAP->JSPJGRP1); 07340000 // Convert to EBCDIC 07350000 memcpy(&(ecawkptr->boxline.boxlnrel.boxinfo.outgrarea.boxjid1), 07360000 dblword,5); // Get JOE ID1 07370000 ecawkptr->boxline.boxlnrel.boxinfo.outgrarea.boxgsep2 = '.'; 07380000 // Insert separator char 07390000 sprintf(dblword, "%.5i", xtpptr->XTPJSPAP->JSPJGRP2); 07400000 // Convert to EBCDIC 07410000 memcpy(&(ecawkptr->boxline.boxlnrel.boxinfo.outgrarea.boxjid2), 07420000 dblword,5); // Get JOE ID2 07430000 // Ensure positive sign 07440000 // Call APSUPUT 07450000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 07460000 // Get address of APSUPUTC 07470000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 07480000 } // End print OUTPUT GROUP line 07490000 if (rtncode ==0) 07500000 { 07510000 /****************************************************** 07520000 Build and print TITLE line 07530000 ******************************************************/ 07540000 clrline(xtpptr); 07550000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBTITLE, 07560000 strlen(LBTITLE)); 07570000 // Put TITLE label 07580000 if ((wrkkylst != 0) && ((wrkkylst + KYLSTTL)->SJTRTPAD != 0)) 07590000 // If there is a KEYLIST 07600000 // AND there is a TITLE TU address in 07610000 // the keylist 07620000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 07630000 &(((wrkkylst + KYLSTTL)->SJTRTPAD)->docntent.DOCNTPAR), 07640000 ((wrkkylst + KYLSTTL)->SJTRTPAD)->docntent.DOCNTLTH); 07650000 // Move the TITLE TU text from the 07660000 // TU output area to the detail line 07670000 // Call APSUPUT 07680000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 07690000 // Get address of APSUPUTC 07700000 AsmFunc(xtpptr, &rtncode); 07710000 // Call APSUPUTC 07720000 } // End print TITLE line 07730000 if (rtncode ==0) 07740000 { 07750000 /****************************************************** 07760000 Build and print a blank line 07770000 ******************************************************/ 07780000 // ( Frame characters in box cols 01 & 80 ) 07790000 clrline(xtpptr); 07800000 // Call APSUPUT 07810000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 07820000 // Get address of APSUPUTC 07830000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 07840000 } // End print blank line 07850000 if (rtncode ==0) 07860000 { 07870000 /****************************************************** 07880000 Build and print DESTINATION line 07890000 ******************************************************/ 07900000 clrline(xtpptr); 07910000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBDEST, 07920000 strlen(LBDEST)); // Put DESTINATION label 07930000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 07940000 xtpptr->XTPJSPAP->JSPJGRPD, STRING_LEN); 07950000 // Put DESTINATION 07960000 // Call APSUPUT 07970000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 07980000 // Get address of APSUPUTC 07990000 AsmFunc(xtpptr, &rtncode); 08000000 // Call APSUPUTC 08010000 } // End print DESTINATION line 08020000 if (rtncode ==0) 08030000 { 08040000 /****************************************************** 08050000 Build and print NAME line 08060000 ******************************************************/ 08070000 clrline(xtpptr); 08080000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBNAME, strlen(LBNAME)); 08090000 // Put NAME label 08100000 if ((wrkkylst != 0) && ((wrkkylst + KYLSTNM)->SJTRTPAD != 0)) 08110000 // If there is a KEYLIST 08120000 // AND there is a NAME TU address in 08130000 // the keylist 08140000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08150000 &(((wrkkylst + KYLSTNM)->SJTRTPAD)->docntent.DOCNTPAR), 08160000 ((wrkkylst + KYLSTNM)->SJTRTPAD)->docntent.DOCNTLTH); 08170000 // Move the NAME TU text from the 08180000 // TU output area to the detail line 08190000 else // There is no keylist 08200000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08210000 xtpptr->XTPJSPAP->JSPJPNAM, STRING_LEN); 08220000 // Put NAME from JSPA 08230000 // Call APSUPUT 08240000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 08250000 // Get address of APSUPUTC 08260000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 08270000 } // End print NAME line 08280000 if (rtncode ==0) 08290000 { 08300000 /****************************************************** 08310000 Build and print ROOM line 08320000 ******************************************************/ 08330000 clrline(xtpptr); 08340000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBROOM, strlen(LBROOM)); 08350000 // Put ROOM label 08360000 if ((wrkkylst != 0) && ((wrkkylst + KYLSTRM)->SJTRTPAD != 0)) 08370000 // If there is a KEYLIST 08380000 // AND there is a ROOM TU address in 08390000 // the keylist 08400000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08410000 &(((wrkkylst + KYLSTRM)->SJTRTPAD)->docntent.DOCNTPAR), 08420000 ((wrkkylst + KYLSTRM)->SJTRTPAD)->docntent.DOCNTLTH); 08430000 // Move the ROOM TU text from the 08440000 // TU output area to the detail line 08450000 else // There is no keylist 08460000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08470000 xtpptr->XTPJSPAP->JSPJRMNO, STRING_LEN1); 08480000 // Put ROOM from JSPA 08490000 // Call APSUPUT 08500000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 08510000 // Get address of APSUPUTC 08520000 AsmFunc(xtpptr, &rtncode); // Call APSUPUT 08530000 } // End print ROOM line 08540000 if (rtncode ==0) 08550000 { 08560000 /****************************************************** 08570000 Build and print BUILDING line 08580000 ******************************************************/ 08590000 clrline(xtpptr); 08600000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBBLDG, strlen(LBBLDG)); 08610000 // Put BLDG label 08620000 if ((wrkkylst != 0) && ((wrkkylst + KYLSTBL)->SJTRTPAD != 0)) 08630000 // If there is a KEYLIST 08640000 // AND there is a BLDG TU address in 08650000 // the keylist 08660000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08670000 &(((wrkkylst + KYLSTBL)->SJTRTPAD)->docntent.DOCNTPAR), 08680000 ((wrkkylst + KYLSTBL)->SJTRTPAD)->docntent.DOCNTLTH); 08690000 // Move the BUILDING TU text from the 08700000 // TU output area to the detail line 08710000 // Call APSUPUT 08720000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 08730000 // Get address of APSUPUTC 08740000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 08750000 } // End print BUILDING line 08760000 if (rtncode ==0) 08770000 { 08780000 /****************************************************** 08790000 Build and print DEPARTMENT line 08800000 ******************************************************/ 08810000 clrline(xtpptr); 08820000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBDEPT, strlen(LBDEPT)); 08830000 // Put DEPT label 08840000 if ((wrkkylst != 0) && ((wrkkylst + KYLSTDP)->SJTRTPAD != 0)) 08850000 // If there is a KEYLIST 08860000 // AND there is a DEPT TU address in 08870000 // the keylist 08880000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 08890000 &(((wrkkylst + KYLSTDP)->SJTRTPAD)->docntent.DOCNTPAR), 08900000 ((wrkkylst + KYLSTDP)->SJTRTPAD)->docntent.DOCNTLTH); 08910000 // Move the DEPT TU text from the 08920000 // TU output area to the detail line 08930000 // Call APSUPUT 08940000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 08950000 // Get address of APSUPUTC 08960000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 08970000 } // End print DEPARTMENT line 08980000 if (rtncode ==0) 08990000 { 09000000 09010000 /****************************************************************** 09020000 * * 09030000 * BUILD AND PRINT ADDRESS LINES * 09040000 * ----------------------------- * 09050000 * The address can be from 1 to 4 lines long. Any lines * 09060000 * that are unused are printed as blank lines, but the * 09070000 * label "ADDRESS:" appears on the first line even if no * 09080000 * address was specified on the OUTPUT JCL. * 09090000 * * 09100000 * A blank line is printed after the four ADDRESS lines. * 09110000 * * 09120000 * If the SWBTUREQ macro returned an error, the ADDRESS * 09130000 * line is not printed. An error message is printed * 09140000 * in the four lines that would have contained the ADDRESS. * 09150000 * * 09160000 ******************************************************************/ 09170000 clrline(xtpptr); 09180000 wrkadnum = XZERO; // Zero number of lines 09190000 if (swberr == 'Y') // SWBTUREQ error? 09200000 { // Yes 09210000 /****************************************************** 09220000 Print the SWBTUREQ error message 09230000 ******************************************************/ 09240000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, LBMSG, 09250000 strlen(LBMSG)); // Set error message text 09260000 // Call APSUPUT 09270000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC;09280000 // Get address of APSUPUTC 09290000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 09300000 if (rtncode == 0) 09310000 { 09320000 clrline(xtpptr); 09330000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.rtncdelbl.boxrclb, 09340000 LBRC, strlen(LBRC)); // Set RETURN CODE label 09350000 sprintf(ecawkptr->boxline.boxlnrel.boxinfo.rtncdelbl.boxrc, 09360000 "%.4i", swbrc); // Convert to EBCDIC 09370000 // Call APSUPUT 09380000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)-> 09390000 ECEPUTC; 09400000 // Get address of APSUPUTC 09410000 AsmFunc(xtpptr, &rtncode); 09420000 // Call APSUPUTC 09430000 } 09440000 if (rtncode == 0) 09450000 { 09460000 clrline(xtpptr); 09470000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.rtnrsncodes.boxrslb, 09480000 LBRS, strlen(LBRS)); // Set REASON CODE label 09490000 sprintf(ecawkptr->boxline.boxlnrel.boxinfo.rtnrsncodes.boxrs, 09500000 "%.4i", swbrs); // Convert to EBCDIC 09510000 // Call APSUPUT 09520000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)-> 09530000 ECEPUTC; 09540000 // Get address of APSUPUTC 09550000 AsmFunc(xtpptr, &rtncode); 09560000 // Call APSUPUTC 09570000 } 09580000 } // End SWBTUREQ error 09590000 else // No SWBTUREQ error 09600000 { 09610000 /****************************************************** 09620000 Print the ADDRESS label 09630000 ******************************************************/ 09640000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBADDR,strlen(LBADDR));09650000 // Put ADDRESS label 09660000 if ((wrkkylst != 0) && // If there is a KEYLIST 09670000 ((wrkkylst + KYLSTAD)->SJTRTPAD != 0) && 09680000 // AND there is an ADDR TU address in 09690000 // the keylist 09700000 ((wrkkylst + KYLSTAD)->SJTRTPAD->docnthdr.DOCNTNUM > 0)) 09710000 // AND > 0 address lines 09720000 { 09730000 if ((wrkkylst + KYLSTAD)->SJTRTPAD->docnthdr.DOCNTNUM <= 4) 09740000 // How many lines used for addr info? 09750000 wrkadnum = (wrkkylst + KYLSTAD)->SJTRTPAD->docnthdr.DOCNTNUM; 09760000 // Fill in number of address lines 09770000 else // Else >4 lines 09780000 wrkadnum = 4; // Set to max of 4 lines 09790000 09800000 /****************************************************** 09810000 Loop to Build/Print Multiple Line ADDRESS 09820000 ******************************************************/ 09830000 // Put address lines 09840000 tempdocptr = &((wrkkylst + KYLSTAD)->SJTRTPAD->docntent); 09850000 // Store address of text entry for 09860000 // first line of address 09870000 // Loop through multiple text entries, printing out each 09880000 // line of the address 09890000 for (addrloop = wrkadnum; addrloop > 0; addrloop--) 09900000 { 09910000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 09920000 &(tempdocptr->DOCNTPAR), tempdocptr->DOCNTLTH); 09930000 // Move the ADDR TU text from the 09940000 // TU output area to the detail line 09950000 // Call APSUPUT 09960000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)-> 09970000 ECEPUTC; 09980000 // Get address of APSUPUTC 09990000 AsmFunc(xtpptr, &rtncode); 10000000 // Call APSUPUTC 10010000 if (rtncode != 0) break; 10020000 tempdocptr = (DOCNTENT *)((byte *)tempdocptr + 10030000 tempdocptr->DOCNTLTH + 2); 10040000 // Increment pointer by length of 10050000 // current entry to get to the next 10060000 // text entry 10070000 // (+2 to get past the length field) 10080000 clrline(xtpptr); 10090000 } // end loop 10100000 } // Keylist != 0, etc 10110000 else 10120000 { // No keylist - print address label 10130000 // Call APSUPUT 10140000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)-> 10150000 ECEPUTC; // Get address of APSUPUTC 10160000 AsmFunc(xtpptr, &rtncode); 10170000 // Call APSUPUTC 10180000 wrkadnum = 1; // Set to 1 line as the address 10190000 // line was printed 10200000 } // end no keylist 10210000 } // end print the address label 10220000 } // End print ADDRESS lines 10230000 if (rtncode ==0) 10240000 { 10250000 /********************************************************* 10260000 Loop to Build/Print Multiple Blank ADDRESS Lines 10270000 *********************************************************/ 10280000 clrline(xtpptr); 10290000 for (unusedlns = (MAX_ADDR_LEN - wrkadnum); 10300000 unusedlns >= 0; 10310000 unusedlns--) 10320000 { 10330000 // Call APSUPUT 10340000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC;10350000 // Get address of APSUPUTC 10360000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 10370000 if (rtncode != 0) break; 10380000 } // end loop 10390000 } // End print multiple blank ADDRESS 10400000 // lines 10410000 if (rtncode ==0) 10420000 { 10430000 /******************************************************** 10440000 * Obtain time and date * 10450000 ********************************************************/ 10460000 10470000 apsutimc(xtpptr, &dateandtime); 10480000 // Call TIME SVC 10490000 10500000 /********************************************************* 10510000 Build and print TIME line 10520000 *********************************************************/ 10530000 clrline(xtpptr); 10540000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBPRTIME, 10550000 strlen(LBPRTIME)); // Put PRINT TIME label 10560000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.boxampm, 10570000 dateandtime.ampm,2); // Put AM/PM label 10580000 ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.sep1 = 10590000 ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.sep2 = ':'; 10600000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.boxhr, 10610000 dateandtime.hours, 2); 10620000 // Copy hours into detail box 10630000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.boxmin, 10640000 dateandtime.minutes, 2); 10650000 // Copy minutes into detail box 10660000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prttimearea.boxsec, 10670000 dateandtime.seconds, 2); 10680000 // Copy seconds into detail box 10690000 // Call APSUPUT 10700000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 10710000 // Get address of APSUPUTC 10720000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 10730000 } // End print TIME line 10740000 if (rtncode==0) 10750000 { 10760000 /********************************************************* 10770000 Build and print DATE line 10780000 *********************************************************/ 10790000 clrline(xtpptr); 10800000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBPRDATE, 10810000 strlen(LBPRDATE)); // Put PRINT DATE label 10820000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prtdatearea.boxdd, 10830000 dateandtime.day, DAY_LEN); 10840000 // Copy day into detail box 10850000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prtdatearea.boxmmm, 10860000 dateandtime.month, MONTH_LEN); 10870000 // Copy month into detail box 10880000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.prtdatearea.boxyear, 10890000 dateandtime.year, YEAR_LEN); 10900000 // Copy year into detail box 10910000 // Call APSUPUT 10920000 AsmFunc = (void (*)()) 10930000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 10940000 // Get address of APSUPUTC 10950000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 10960000 } // End print DATE line 10970000 if (rtncode==0) 10980000 { 10990000 /********************************************************* 11000000 Build and print PRINTER NAME line 11010000 *********************************************************/ 11020000 clrline(xtpptr); 11030000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBPRNAME, 11040000 strlen(LBPRNAME)); // Put PRINTER NAME label 11050000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 11060000 xtpptr->XTPJSPAP->JSPADEVN, STRING_LEN); 11070000 // Put device NAME 11080000 // Call APSUPUT 11090000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 11100000 // Get address of APSUPUTC 11110000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 11120000 } // End print PRINTER NAME line 11130000 if (rtncode ==0) 11140000 { 11150000 /********************************************************* 11160000 Build and print SYSTEM NAME line 11170000 *********************************************************/ 11180000 clrline(xtpptr); 11190000 memcpy(ecawkptr->boxline.boxlnrel.boxdesc, LBSYSTEM, 11200000 strlen(LBSYSTEM)); // Put SYSTEM label 11210000 memcpy(ecawkptr->boxline.boxlnrel.boxinfo.boxmsg1, 11220000 xtpptr->XTPJSPAP->JSPAJMR->JMRCPUID); 11230000 // Put SYSTEM ID 11240000 // Call APSUPUT 11250000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 11260000 // Get address of APSUPUTC 11270000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 11280000 } // End print SYSTEM NAME line 11290000 if (rtncode ==0) 11300000 { 11310000 /********************************************************* 11320000 Build and print 2 blank lines 11330000 *********************************************************/ 11340000 clrline(xtpptr); 11350000 // Call APSUPUT to print 2 blank lines 11360000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 11370000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=2; 11380000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 11390000 { 11400000 // Call APSUPUT 11410000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC;11420000 // Get address of APSUPUTC 11430000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 11440000 if (rtncode != 0) break; 11450000 } 11460000 } // End print 2 blank lines 11470000 if (rtncode ==0) 11480000 { 11490000 /********************************************************* 11500000 Build and print bottom line 11510000 *********************************************************/ 11520000 clrline(xtpptr); 11530000 memcpy(&(ecawkptr->boxline), ENDTAG, strlen(ENDTAG)); 11540000 // Move in END tag 11550000 memcpy((byte *)(&(ecawkptr->boxline)) + strlen(ENDTAG), 11560000 &(ecawkptr->boxline),BOXLINE_LEN - 10); 11570000 // Propogate chars 11580000 // Call APSUPUT 11590000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 11600000 // Get address of APSUPUTC 11610000 AsmFunc(xtpptr, &rtncode); // Call APSUPUTC 11620000 } // End print bottom line 11630000 11640000 } // End not DPF-attached printer 11650000 11660000 return; // Return with no error 11670000 11680000 } // End of main routine 11690000 11700000 /********************************************************************** 11710000 * * 11720000 * CLRLINE - Clears the separator page line and inserts the box frame * 11730000 * characters. * 11740000 * This is necessary so as to avoid printing detail box * 11750000 * information left over from previous processing with the * 11760000 * current line. * 11770000 * INPUT : Pointer to APSGEXTP * 11780000 * * 11790000 * OUTPUT : The separator page line is cleared and the frame chars * 11800000 * inserted in columns 1 and 80 of the detail box. * 11810000 * ECARECAD = Address of the separator page line * 11820000 * ECARECLN = Length of the separator page line * 11830000 * * 11840000 **********************************************************************/ 11850000 11860000 void clrline(APSGEXTP * xtpptr) 11870000 { 11880000 ecawkptr->wrkcc = 0x09; // Set CC to write one line 11890000 memset(ecawkptr, BLANK, PRINTLINE_LEN); 11900000 // Clear printline 11910000 ecawkptr->boxline.boxlnrel.boxcol1 = '*'; 11920000 ecawkptr->boxline.boxlnrel.boxcol80 = '*'; 11930000 // Insert box frame character 11940000 xtpptr->XTPECAP->ECABASE.ECARECAD = 11950000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 11960000 // Get record address 11970000 xtpptr->XTPECAP->ECABASE.ECARECLN = ESSLLEN; 11980000 // Get length of record 11990000 } 12000000 12010000