ASNA WingsRPG™ Reference Manual |
Naming an IBM i Job
Users can designate the names of IBM
i jobs created by Wings using the TerminalDeviceName
property.
Interactive Job Implementation
The property is applied in the WingsJob class:
myDatabase = new AVRRuntime.Database("", AVRRuntime.VirtualTerminal.MonarchWeb, AVRRuntime.OpenAccessDspF.Wings);
myDatabase.TerminalDeviceName =
"MYDEV??";
The TerminalDeviceName
property takes any string the developer inputs, and
as a special option the string can include up to three trailing question marks (?
) (i.e. MYDEV???
). When a sequence of question marks are used in the trailing position
of the device name, a 10 character name is generated substituting the '?
' sequence with a
(sequential) hexadecimal number (e.g. MYDEV00010
).
The string length must be 8 or fewer characters, including any question marks. If a job using the specified name already exists, Wings will loop, and attempt to create a job one hex-digit higher until it lands on a job name that does not exist. If the name specified in the database connection is not available (or exceeds 8 characters), DataGate will throw an exception with one of the following values:
Name | Value |
---|---|
dgEx | {"DeviceName Not Available"} |
base | {"DeviceName Not Available"} |
DefaultErrorClass | dgEC_Base |
Error | dgEDEVICENAME |
ErrorClass | dgEC_Base |
Message | "DeviceName Not Available" |
ErrorClass | dgEC_Base |
Message |
"DeviceName Not Available" |
SystemError |
0 |
Text |
"" |
The same exception will be thrown if the device name specified contains a suffix of question marks and no device available satisfies the name (all 'numbers' have been exhausted).
Important – While this can potentially support a very high number of job names, the number of iterations it demands makes this a very inefficient choice for supporting more than 20-30 simultaneous jobs with one Wings application.
If the application is going to be naming Jobs, it is highly recommended that the system value QDEVRCYACN
be set to either *ENDJOB
or *ENDJOBNOLIST
. Please see IBM's documentation at
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/rzakz/rzakzqdevrcyacn.htm
To support larger numbers of similarly named jobs
without excessive wait times, Wings is compatible with
Telnet exit-point programs that can dynamically create larger
numbers of similar job names without resorting to repeated
calls to the IBM i.
Batch Job Implementation
The property is applied in the WingsJob class:
myDatabase = new AVRRuntime.Database("", AVRRuntime.VirtualTerminal.none, AVRRuntime.OpenAccessDspF.Wings);
myDatabase.TerminalDeviceName =
"MYJOBNAME;
As in interactive jobs, the TerminalDeviceName
property takes any string the developer inputs, but doesn't support
question marks or other special characters. If the TerminalDeviceName
property is not set the Job Name will default to DG8_NET
.