NetBatch Management Programming Manual
NetBatch Procedure Calls
NetBatch Management Programming Manual—522462-003
7-12
Sample C Program
Example 7-1. Sample NB^JOB^SUBMIT C Program
#pragma INSPECT,SYMBOLS
#pragma NOMAP
#pragma NOLMAP
#pragma RUNNABLE
#pragma NOXMEM
/* NOXMEM is mandatory because NB^JOB^SUBMIT cannot access extended memory */
#pragma HEAP 20 pages
#pragma SEARCH "$SYSTEM.SYSTEM.BATCHLIB"
/* OVERVIEW:
*-------------------------------------------------------------------------*
* This is an example program to be included in the SPI
*
* Manual to illustrate the programmatic use of NB^JOB^SUBMIT
*
* to submit a job to a NetBatch Scheduler.
*
*
*
* It performs two functions:
*
* a) Submits a job to NetBatch,
*
* b) Interprets any errors returned by the Scheduler
*
* and displays those details to the user.
*
*-------------------------------------------------------------------------*
*/
#include <memoryh> nolist
#include <stdioh> nolist
#include <stringh> nolist
#include <stdlibh> nolist
#include <talh> nolist
#include <cextdecs> nolist
/* START STRUCTURE DEFINITIONS FOR NB^JOB^SUBMIT */
/* Submit record */
struct SUBMIT_REC_DEF
{
char filler_0[12];
char actual_job_name[24];
short filler_1;
struct
{
char scheduler[18];
char jclass[24];
char executor_program[36];
short filler_2;
struct
{
short b;
} print_lines;
struct
(continued)