$EdScan: Difference between revisions
m (1 revision) |
m (misc formatting) |
||
(34 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Scan list of entities in online</span> | <span class="pageSubtitle">Scan list of entities in online</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Most $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $EdScan function.</p> | ||
This function scans the list of defined entities in the online region. Entities can be 204 | This function scans the list of defined entities in the online region. Entities can be Model 204 data sets, sequential files or streams, printers, punches or processes. | ||
The <var>$EdScan</var> function accepts four arguments and returns a number indicating the success of the function. | The <var>$EdScan</var> function accepts four arguments and returns a number indicating the success of the function. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%result</span> = <span class="literal">$EdScan</span>(<span class="term">imageName</span>, [<span class="term">type</span>], [<span class="term">scope</span>], [<span class="term">name</span>]) | ||
< | |||
< | |||
</p> | </p> | ||
<ul> | <ul> | ||
<li><var class="term">%result</var> is a 0 or to an error code.</li> | |||
<li><var class="term">imageName</var> is a string identifying an image to receive returned data. This image must have the following format : | |||
<p class="code"><nowiki>image entity | |||
loopVar is binary len 4 | |||
name is string len 8 | |||
scope is string len 6 | |||
type is string len 8 | |||
* This section used just for DATASET + ALLOCATE: | |||
dsname is string len 44 | |||
dsorg is string len 10 | |||
alloc is string len 4 | |||
disp is string len 5 | |||
* This section just used for PRINTER + PUNCH: | |||
class is string len 1 | |||
route is string len 8 | |||
id is string len 8 | |||
dist is string len 8 | |||
forms is string len 8 | |||
* This section just used for LINK: | |||
transport is string len 8 at dsname | |||
protocol is string len 8 | |||
* This section just used for PROCESS: | |||
destination is string len 8 at dsname | |||
partner is string len 10 | |||
mode is string len 4 | |||
* This section just used for PROCESSGROUP: | |||
link is string len 8 at dsname | |||
remoteid is string len 8 | |||
terminal is string len 8 | |||
end image | |||
</nowiki></p> | |||
<p> | |||
<code>alloc</code> returns NEW, OLD, or COND, and <code>disp</code> returns SHARE or EXCL. This is a required argument. </p></li> | |||
<li> | <li><var class="term">type</var> is a string indicating the type of entity for which information is to be returned. Valid types are: | ||
< | <table class="thJustBold"> | ||
</ | |||
<table class=" | |||
<tr><th>ALLOCATE</th> | <tr><th>ALLOCATE</th> | ||
<td>Files allocated by the ALLOCATE command.</td></tr> | <td>Files allocated by the <var>ALLOCATE</var> command.</td></tr> | ||
<tr><th>DATASET</th> | <tr><th>DATASET</th> | ||
<td>Files defined by the DEFINE DATASET command.</td></tr> | <td>Files defined by the <var>DEFINE DATASET</var> command.</td></tr> | ||
<tr><th>PRINTER</th> | <tr><th>PRINTER</th> | ||
<td>Printers defined by the DEFINE PRINTER command.</td></tr> | <td>Printers defined by the <var>DEFINE PRINTER</var> command.</td></tr> | ||
<tr><th>PUNCH</th> | <tr><th>PUNCH</th> | ||
<td>Punches defined by the DEFINE PUNCH command.</td></tr> | <td>Punches defined by the <var>DEFINE PUNCH</var> command.</td></tr> | ||
<tr><th>STREAM</th> | <tr><th>STREAM</th> | ||
<td>Files defined by the DEFINE STREAM command.</td></tr> | <td>Files defined by the <var>DEFINE STREAM</var> command.</td></tr> | ||
<tr><th>PROCESS</th> | <tr><th>PROCESS</th> | ||
<td>Processes defined by the DEFINE PROCESS command. | <td>Processes defined by the <var>DEFINE PROCESS</var> command. </td></tr> | ||
</td></tr></table> | </table> | ||
This is an optional argument. | <p> | ||
<li> | This is an optional argument. </p></li> | ||
<li> | |||
<li><var class="term">scope</var> is a string indicating the scope of the entities for which information is to be returned. Valid scopes are 'SYSTEM' and 'USER'. | |||
<p> | |||
This is an optional argument. If not specified, all entities are returned. </p></li> | |||
<li><var class="term">name</var> is the name of the entity for which information is to be returned. This is an optional argument, but if it is specified, arguments 2 and 3 are also required. </li> | |||
</ul> | </ul> | ||
In the image | In the <var class="term">imageName</var> image, <code>loopVar</code> must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, <var>$EdScan</var> sets <code>loopVar</code> to the number of entries skipped plus one (if an entity is returned) or to the number of entries skipped (otherwise). Thus, multiple invocations of <var>$EdScan</var> without setting <code>loopVar</code> return information on all appropriate entities. | ||
===Status codes=== | |||
<p class="code"> 0 - Entity found, image set | |||
4 - Entity not found, or off end of chain | |||
8 - Invalid argument 1 or argument 2 | |||
12 - Argument 4 specified without argument 2 or 3 | |||
16 - Image specified by argument 1 not found | |||
20 - Image specified by argument 1 not active, or too short | |||
</p> | </p> | ||
==Example== | |||
The following program prints the DD and DSNAME of all ALLOCATE'd datasets. | The following program prints the DD and DSNAME of all ALLOCATE'd datasets. | ||
<p class="code"> | <p class="code">begin | ||
image junkEntity | |||
var is binary len 4 | |||
... | ... | ||
end image | |||
prepare image junkEntity | |||
repeat forever | |||
<!-- Note that the first arg is intentionally shown with different casing than the image declaration: --> | |||
%rc = $edScan('junkentity', 'ALLOCATE', 'SYSTEM') | |||
if %rc then | |||
stop | |||
end if | |||
print %junk:name and %junk:dsname | |||
end repeat | |||
end | |||
</p> | </p> | ||
==Products authorizing {{PAGENAMEE}}== | |||
<li>[[Sirius functions]]</li> | <ul class="smallAndTightList"> | ||
<li>[[List of $functions|Sirius functions]]</li> | |||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[[Janus Open Client]]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[[Janus Open Server]]</li> | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li> | <li>Japanese functions</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$EdScan]] | [[Category:$Functions|$EdScan]] |
Latest revision as of 19:56, 3 August 2017
Scan list of entities in online
Note: Most $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $EdScan function.
This function scans the list of defined entities in the online region. Entities can be Model 204 data sets, sequential files or streams, printers, punches or processes.
The $EdScan function accepts four arguments and returns a number indicating the success of the function.
Syntax
%result = $EdScan(imageName, [type], [scope], [name])
- %result is a 0 or to an error code.
- imageName is a string identifying an image to receive returned data. This image must have the following format :
image entity loopVar is binary len 4 name is string len 8 scope is string len 6 type is string len 8 * This section used just for DATASET + ALLOCATE: dsname is string len 44 dsorg is string len 10 alloc is string len 4 disp is string len 5 * This section just used for PRINTER + PUNCH: class is string len 1 route is string len 8 id is string len 8 dist is string len 8 forms is string len 8 * This section just used for LINK: transport is string len 8 at dsname protocol is string len 8 * This section just used for PROCESS: destination is string len 8 at dsname partner is string len 10 mode is string len 4 * This section just used for PROCESSGROUP: link is string len 8 at dsname remoteid is string len 8 terminal is string len 8 end image
alloc
returns NEW, OLD, or COND, anddisp
returns SHARE or EXCL. This is a required argument. - type is a string indicating the type of entity for which information is to be returned. Valid types are:
ALLOCATE Files allocated by the ALLOCATE command. DATASET Files defined by the DEFINE DATASET command. PRINTER Printers defined by the DEFINE PRINTER command. PUNCH Punches defined by the DEFINE PUNCH command. STREAM Files defined by the DEFINE STREAM command. PROCESS Processes defined by the DEFINE PROCESS command. This is an optional argument.
- scope is a string indicating the scope of the entities for which information is to be returned. Valid scopes are 'SYSTEM' and 'USER'.
This is an optional argument. If not specified, all entities are returned.
- name is the name of the entity for which information is to be returned. This is an optional argument, but if it is specified, arguments 2 and 3 are also required.
In the imageName image, loopVar
must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, $EdScan sets loopVar
to the number of entries skipped plus one (if an entity is returned) or to the number of entries skipped (otherwise). Thus, multiple invocations of $EdScan without setting loopVar
return information on all appropriate entities.
Status codes
0 - Entity found, image set 4 - Entity not found, or off end of chain 8 - Invalid argument 1 or argument 2 12 - Argument 4 specified without argument 2 or 3 16 - Image specified by argument 1 not found 20 - Image specified by argument 1 not active, or too short
Example
The following program prints the DD and DSNAME of all ALLOCATE'd datasets.
begin image junkEntity var is binary len 4 ... end image prepare image junkEntity repeat forever %rc = $edScan('junkentity', 'ALLOCATE', 'SYSTEM') if %rc then stop end if print %junk:name and %junk:dsname end repeat end