NetBatch Management Programming Manual

Sample Programs
NetBatch Management Programming Manual522462-003
C-14
Sample C Program
/* Get the job-name token returned in the SPI buffer */
spi_err = SSGETTKN ( (short *) spi_buff,
(long) ZBAT_TKN_SEL_JOBNAME,
(char *) &work_area,
1
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essgettkn);
cptr = strncpy (jobname.u_z_c.z_c, work_area.str, work_area.len);
printf(" Job name : %s\n\n", jobname.u_z_c.z_c);
/* Perform a status job command on the job number and print details */
status_job(jobnumber);
printf(" Job status from $ZBAT using SPI\n\n");
/* Get the zbat_map_status_job map returned in the SPI buffer */
spi_err = SSGET ( (short *) spi_buff,
(short *) zbat_map_status_job,
(char *) &STATUS,
1
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essget);
printf(" Selpri : %d \n", STATUS.zselpri);
printf(" Class : %s \n\n",
STATUS.zclassname.u_z_c.z_c);
/* Close scheduler for SPI comms */
closedown();
}