NetBatch Management Programming Manual
Sample Programs
NetBatch Management Programming Manual—522462-003
C-10
Sample C Program
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essputtkn);
/* Insert the in-file token */
strcpy (work_area.str, getenv("DEFAULTS"));
strcat (work_area.str, ".INFILE");
work_area.len = strlen(work_area.str);
spi_err = SSPUTTKN (
(short *) spi_buff, /* SPI buffer */
(long) ZBAT_TKN_IN_FILE, /* Token ID */
(char *) &work_area /* Token value */
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essputtkn);
/* Insert the out-file token */
strcpy (work_area.str, "$S.#MASTERA");
work_area.len = strlen(work_area.str);
spi_err = SSPUTTKN (
(short *) spi_buff, /* SPI buffer
*/
(long) ZBAT_TKN_OUT_FILE, /* Token ID
*/
(char *) &work_area /* Token value
*/
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essputtkn);
/* Set up ZBAT-MAP-DEF-JOB */
/* Initialize the JOB_MAP for JOB SUBMIT to nulls */
spi_err = SSNULL ((short *) zbat_map_def_job, (char *) &JOB );
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essnull);
/* Move a set of constant values into the job structure for submission
*/
cptr = strncpy (JOB.zclassname.u_z_c.z_c, "CLASS-A
",24);
JOB.zhold = ZSPI_VAL_TRUE;
JOB.zhold_after = ZSPI_VAL_TRUE;
JOB.zdefault_security = 04444; /* Octal 4444 = NNNN */
(continued)