NetBatch Management Programming Manual

Sample Programs
NetBatch Management Programming Manual522462-003
C-8
Sample C Program
/* Get the RETCODE token returned in the SPI buffer */
spi_err = SSGETTKN ( (short *) spi_buff,
(long) ZSPI_TKN_RETCODE,
(char *) &retcode,
1
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essgettkn);
/* Return the SPI RETCODE */
return (retcode);
}
#pragma page
/*
*--------------------------------------------------------------------
* submit_job
* Use:
* Submits a job to the scheduler
* Effects:
* Sets SPI buffer to job submit details if successful
* Stops program otherwise
*
*--------------------------------------------------------------------
*/
void submit_job(void)
{
int retcode = 0;
char *cptr;
/* Initialize the SPI buffer */
spi_err = SSINIT (
(short *) spi_buff /* SPI buffer
*/
,(ZBAT_VAL_BUFLEN+6) /* SPI buffer length
*/
,(short *) &zbat_val_ssid /* SSID - subsystem ID
*/
,ZSPI_VAL_CMDHDR /* SPI buffer type
*/
,ZBAT_CMD_SUBMIT /* Command number
*/
,ZBAT_OBJ_JOB /* Object type
*/
,0 /* Max-resp */
, /* Server-vrsn
*/
,ZSPI_VAL_TRUE /* Checksum enabled
*/
(continued)