//**** START OF SPECIFICATIONS *****************************************00010000 //* *00020000 //* MODULE NAME = APSUC03 *00030000 //* *00040000 //* $MOD(APSUC03 ) COMP(APS) PROD(PSF) : VERSION 3.3.0 *00050000 //* *00060000 //* DESCRIPTIVE NAME = Data set header installation exit example *00070000 //* *00080000 //* STATUS = Version 3, Release 3, Level 0 *00090000 //* *00100000 //* FUNCTION = *00110000 //* Print a data set separator page *00120000 //* *00130000 //* OPERATION = *00140000 //* 1. Create 12 block letter line records for the step name, *00150000 //* dd name, sysout class, and priority (if > 0). *00160000 //* 2. Pass the block letter lines to PSF. *00170000 //* *00180000 //* NOTES = *00190000 //* APSUPUTC and APSUBLKC are assembler routines which put *00200000 //* values into registers, and call the PLX routines APSUPUT *00210000 //* and APSUBLK. The address of these 2 routines can be found *00220000 //* in (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC and *00230000 //* (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC. *00240000 //* *00250000 //* Each of these routines accepts 2 parameters : the address *00260000 //* of APSGEXTP (xtpptr), and a return code. *00270000 //* *00280000 //* APSUBLK is called with the data to be expanded in ECABLKIN. *00290000 //* It puts the expanded block letters into ECAWKBUF, beginning *00300000 //* with the second byte of ECAWKBUF. The first byte is *00310000 //* reserved for the printer control characters for the first *00320000 //* block letter print line. *00330000 //* *00340000 //* APSUPUT is called with the records to be passed to PSF for *00350000 //* printing pointed to by ECARECAD. *00360000 //* *00370000 //* DEPENDENCIES = NONE *00380000 //* RESTRICTIONS = NONE *00390000 //* *00400000 //* MODULE TYPE = PROCEDURE *00410000 //* PROCESSOR = C *00420000 //* ATTRIBUTES = *00430000 //* REENTRANT, SUPERVISOR STATE, CALLER'S KEY,PAGABLE, *00440000 //* AMODE 31, RMODE ANY *00450000 //* *00460000 //* ENTRY POINT = APSUC03 *00470000 //* LINKAGE = *00480000 //* One parameter is passed - the address of APSGEXTC *00490000 //* *00500000 //* INPUT = *00510000 //* APSGEXTC - PSF installation exit parameter area *00520000 //* *00530000 //* OUTPUT = *00540000 //* Line data records *00550000 //* *00560000 //* EXIT NORMAL = Return to caller *00570000 //* *00580000 //* EXIT ERROR = None *00590000 //* *00600000 //* EXTERNAL REFERENCES = *00610000 //* ROUTINES = *00620000 //* APSUBLKC - Calls APSUBLK to build block letter records *00630000 //* APSUPUTC - Calls APSUPUT to put record to PSF *00640000 //* DATA AREAS = *00650000 //* APSGEXTC - PSF installation exit parameter area *00660000 //* APSUECAC - PSF exit communications area *00670000 //* APSUJSPC - JES separator page area *00680000 //* *00690000 //* MACROS = None *00700000 //* *00710000 //* MESSAGES = None *00720000 //* *00730000 //* $B0=OW45952, HPRF320, 000829, BDKUEAS: Initial Version @B0A*00740000 //* $EV=LAPS0009,HPRF330,010530,BUQ4RLB: Version 3.3.0 @EVA*00750000 //* *00760000 //**** END OF SPECIFICATIONS *******************************************00770000 00780000 #pragma comment(date) 00790000 #pragma csect(CODE,"$APSUC03") 00800000 #pragma csect(STATIC,"#APSUC03") 00810000 #pragma linkage(APSUC03,OS) 00820000 #pragma runopts(TRAP(OFF)) 00830000 #pragma map(apsuc03,"APSUC03") 00840000 00850000 00860000 /*--------------------------------------------------------------------- 00870000 #include these header files for structure & function definitions: 00880000 ---------------------------------------------------------------------*/ 00890000 00900000 #include "apsgextc.h" 00910000 #include "apsuecac.h" 00920000 #include "apsujspc.h" 00930000 00940000 //**********************************************************************00950000 //* Misc constants 00960000 //**********************************************************************00970000 00980000 #define RECLGTH 132 00990000 #define BLANK ' ' 01000000 01010000 //**********************************************************************01020000 //* ECA Work buffer mapping 01030000 //**********************************************************************01040000 01050000 typedef struct // Separator work buffer 01060000 { 01070000 unsigned char wrkcc; // CC 01080000 unsigned char printpos; // Used to print blank lines 01090000 01100000 } BUFWRK; // routine 01110000 01120000 /*--------------------------------------------------------------------- 01130000 Typedefs 01140000 ---------------------------------------------------------------------*/ 01150000 01160000 typedef unsigned char byte; // Used for pointer arithmetic 01170000 01180000 typedef unsigned char (* ECABUFPTR)Ý1¨; 01190000 // Used to correctly cast pointer after01200000 // pointer arithmetic 01210000 01220000 /*--------------------------------------------------------------------- 01230000 Declarations 01240000 ---------------------------------------------------------------------*/ 01250000 01260000 int rtncode = 0; // Return code from APSUPUT 01270000 01280000 char readableÝ3¨; // Used to hold printable priority num 01290000 01300000 BUFWRK * ecawkptr; // ECA work buf pointer 01310000 01320000 void (*AsmFunc)(); // Holds address of APSUPUTC and 01330000 // APSUBLKC 01340000 01350000 void apsuc03(APSGEXTP * xtpptr) 01360000 { 01370000 01380000 xtpptr->XTPECAP->ECABASE.ECAFLAGS &= 0x3F; 01390000 // Reset left justify and slant flag 01400000 xtpptr->XTPECAP->ECABASE.ECADRF = 0x00; 01410000 // Reset record type flags 01420000 xtpptr->XTPECAP->ECABASE.ECADRF |= ECALMR | ECAMACH; 01430000 // Set line mode and machine code flag 01440000 xtpptr->XTPECAP->ECABASE.ECARECLN = 1; 01450000 // Get length of record 01460000 ecawkptr = (BUFWRK *)&(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 01470000 // Get address of ECA work area 01480000 xtpptr->XTPECAP->ECABASE.ECARECAD = 01490000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 01500000 // Get record address 01510000 01520000 /********************************************************************* 01530000 Print 15 blank lines down the page to step name line 01540000 ********************************************************************/ 01550000 xtpptr->XTPECAP->ECABASE.ECARECLN = 2; 01560000 // Set length of print line 01570000 ecawkptr->wrkcc = 0x09; // Set CC to write 01580000 ecawkptr->printpos = BLANK; 01590000 // Set print position to blank 01600000 01610000 // Call APSUPUT to print 15 short lines 01620000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 01630000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=15; 01640000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 01650000 { 01660000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 01670000 // Get address of APSUPUTC 01680000 AsmFunc(xtpptr, &rtncode); 01690000 // Call APSUPUTC 01700000 if (rtncode != 0) break; 01710000 } 01720000 01730000 /********************************************************************* 01740000 Print the step name in straight block letters 01750000 *********************************************************************/ 01760000 if (rtncode == 0) 01770000 { 01780000 memcpy(xtpptr->XTPECAP->ECABASE.ECABLKIN, 01790000 xtpptr->XTPJSPAP->JSPJDSNM.JSPJDSSN,8); 01800000 // Get step name 01810000 // Call APSUBLK 01820000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC; 01830000 // Get address of APSUBLKC 01840000 AsmFunc(xtpptr, &rtncode); 01850000 // Call APSUBLKC 01860000 xtpptr->XTPECAP->ECABASE.ECARECLN = RECLGTH; 01870000 // Set length of record 01880000 xtpptr->XTPECAP->ECABASE.ECARECAD = 01890000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 01900000 // Get record address 01910000 ecawkptr->wrkcc = 0x09; // Set CC to write 01920000 01930000 if (rtncode == 0) // If rc==0 from APSUBLK 01940000 // Call APSUPUT to print step name 01950000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 01960000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=12; 01970000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 01980000 { 01990000 // Call APSUPUT 02000000 AsmFunc = (void (*)())(xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 02010000 // Get address of APSUPUTC 02020000 AsmFunc(xtpptr, &rtncode); 02030000 // Call APSUPUTC 02040000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02050000 (ECABUFPTR)((byte *)xtpptr->XTPECAP->ECABASE.ECARECAD + 132); 02060000 // Get next record to print 02070000 ecawkptr = (BUFWRK *)((byte *)ecawkptr + 132); 02080000 // Increment ecawkptr 02090000 ecawkptr->wrkcc = 0x09; // Set CC to write 02100000 if (rtncode != 0) break; 02110000 } 02120000 02130000 if (rtncode == 0) 02140000 { 02150000 02160000 /******************************************************* 02170000 * PROVIDE 3 BLANK LINES BETWEEN BLOCK LETTER GROUPS 02180000 *******************************************************/ 02190000 02200000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02210000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 02220000 // Get record address 02230000 xtpptr->XTPECAP->ECABASE.ECARECLN = 2; 02240000 // Set length of record 02250000 ecawkptr->wrkcc = 0x09; // Set CC to write 02260000 ecawkptr->printpos = BLANK; 02270000 // Set print position to blank 02280000 // Call APSUPUT to print 3 blank lines 02290000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 02300000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=3; 02310000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 02320000 { 02330000 // Call APSUPUT 02340000 AsmFunc = (void (*)()) 02350000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 02360000 // Get address of APSUPUTC 02370000 AsmFunc(xtpptr, &rtncode); 02380000 // Call APSUPUTC 02390000 if (rtncode != 0) break; 02400000 } 02410000 02420000 if (rtncode == 0) 02430000 { 02440000 02450000 /************************************************************** 02460000 PRINT THE DD NAME IN BLOCK LETTERS 02470000 **************************************************************/ 02480000 02490000 memcpy(xtpptr->XTPECAP->ECABASE.ECABLKIN, 02500000 xtpptr->XTPJSPAP->JSPJDSNM.JSPJDSDD,8); 02510000 // Get DD name 02520000 // Call APSUBLK 02530000 AsmFunc = (void (*)()) 02540000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC; 02550000 // Get address of APSUBLKC 02560000 AsmFunc(xtpptr, &rtncode); 02570000 // Call APSUBLKC 02580000 xtpptr->XTPECAP->ECABASE.ECARECLN = RECLGTH; 02590000 // Set length of record 02600000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02610000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 02620000 // Get record address 02630000 ecawkptr->wrkcc = 0x09; // Set CC to write 02640000 if (rtncode == 0) // If rc==0 from APSUBLK 02650000 // Call APSUPUT to print dd name 02660000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 02670000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=12; 02680000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 02690000 { 02700000 // Call APSUPUT 02710000 AsmFunc = (void (*)()) 02720000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 02730000 // Get address of APSUPUTC 02740000 AsmFunc(xtpptr, &rtncode); 02750000 // Call APSUPUTC 02760000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02770000 (ECABUFPTR)((byte *)xtpptr->XTPECAP->ECABASE.ECARECAD + 132);02780000 // Get next record to print 02790000 ecawkptr = (BUFWRK *)((byte *)ecawkptr + 132); 02800000 // Increment ecawkptr 02810000 ecawkptr->wrkcc = 0x09; 02820000 // Set CC to write 02830000 if (rtncode != 0) break; 02840000 } 02850000 02860000 if (rtncode == 0) 02870000 { 02880000 /******************************************************* 02890000 * PROVIDE 3 BLANK LINES BETWEEN BLOCK LETTER GROUPS 02900000 *******************************************************/ 02910000 02920000 xtpptr->XTPECAP->ECABASE.ECARECLN = 2; 02930000 // Set length of record 02940000 xtpptr->XTPECAP->ECABASE.ECARECAD = 02950000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 02960000 // Get record address 02970000 ecawkptr->wrkcc = 0x09; 02980000 // Set CC to write 02990000 ecawkptr->printpos = BLANK; 03000000 // Set print position to blank 03010000 // Call APSUPUT to print 3 blank lines 03020000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 03030000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=3; 03040000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 03050000 { 03060000 // Call APSUPUT 03070000 AsmFunc = (void (*)()) 03080000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 03090000 // Get address of APSUPUTC 03100000 AsmFunc(xtpptr, &rtncode); 03110000 // Call APSUPUTC 03120000 if (rtncode != 0) break; 03130000 } 03140000 03150000 if (rtncode == 0) 03160000 { 03170000 03180000 /**************************************************** 03190000 * PRINT THE SYSOUT CLASS & PRIORITY IN BLOCK LETTERS 03200000 *****************************************************/ 03210000 03220000 memset(xtpptr->XTPECAP->ECABASE.ECABLKIN, 03230000 BLANK,8); // Reset input area to blanks 03240000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ1¨ = 03250000 xtpptr->XTPJSPAP->JSPJSOCL; 03260000 // Set sysout class 03270000 if (xtpptr->XTPJSPAP->JSPJPRIO != 0) 03280000 // Is data set priority # set? 03290000 { // If set, convert priority # from 03300000 // binary to printable EBCDIC 03310000 03320000 sprintf(readable, "%i", xtpptr->XTPJSPAP->JSPJPRIO); 03330000 // Convert number to EBCDIC 03340000 03350000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ4¨ = readableÝ0¨; 03360000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ5¨ = readableÝ1¨; 03370000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ6¨ = readableÝ2¨; 03380000 // Set priority # into block 03390000 // letter input field 03400000 if (xtpptr->XTPECAP->ECABASE.ECABLKINÝ4¨ == 0) 03410000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ4¨ = ' '; 03420000 if (xtpptr->XTPECAP->ECABASE.ECABLKINÝ5¨ == 0) 03430000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ5¨ = ' '; 03440000 if (xtpptr->XTPECAP->ECABASE.ECABLKINÝ6¨ == 0) 03450000 xtpptr->XTPECAP->ECABASE.ECABLKINÝ6¨ = ' '; 03460000 } // End conversion of priority # 03470000 03480000 03490000 // Call APSUBLK 03500000 AsmFunc = (void (*)()) 03510000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEBLKC; 03520000 // Get address of APSUBLKC 03530000 AsmFunc(xtpptr, &rtncode); 03540000 // Call APSUBLKC 03550000 xtpptr->XTPECAP->ECABASE.ECARECLN = RECLGTH; 03560000 // Set length of record 03570000 xtpptr->XTPECAP->ECABASE.ECARECAD = 03580000 &(xtpptr->XTPECAP->ECABASE.ECAWKBUF); 03590000 // Get record address 03600000 ecawkptr->wrkcc = 0x09; 03610000 // Set CC to write 03620000 // Call APSUPUT to print sysout class and priority 03630000 if (rtncode == 0) // If rc==0 from APSUBLK 03640000 for (xtpptr->XTPECAP->ECABASE.ECAGWRK = 1; 03650000 xtpptr->XTPECAP->ECABASE.ECAGWRK<=12; 03660000 xtpptr->XTPECAP->ECABASE.ECAGWRK++) 03670000 { 03680000 // Call APSUPUT 03690000 AsmFunc = (void (*)()) 03700000 (xtpptr->XTPECAP->ECABASE.ECAECEP)->ECEPUTC; 03710000 // Get address of APSUPUTC 03720000 AsmFunc(xtpptr, &rtncode); 03730000 // Call APSUPUTC 03740000 xtpptr->XTPECAP->ECABASE.ECARECAD = (ECABUFPTR) 03750000 ((byte *)xtpptr->XTPECAP->ECABASE.ECARECAD + 132); 03760000 // Get next record to print 03770000 ecawkptr = (BUFWRK *)((byte *)ecawkptr + 132); 03780000 // Increment ecawkptr 03790000 ecawkptr->wrkcc = 0x09; 03800000 // Set CC to write 03810000 if (rtncode != 0) break; 03820000 } 03830000 03840000 03850000 } // End rc==0 printing 3 blank lines 03860000 } // End rc==0 printing dd name 03870000 } // End rc==0 printing 3 blank lines 03880000 } // End rc==0 printing step name 03890000 } // End rc==0 printing blank lines 03900000 03910000 return; // Return with no error 03920000 03930000 } // End of main routine 03940000 03950000 03960000 03970000 03980000