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