$EdScan: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (misc formatting)
 
(37 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="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $EdScan function.</p>
<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 datasets, sequential files or streams, printers, punches or processes.  
This function scans the list of defined entities in the online region. Entities can be Model&nbsp;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"><section begin="syntax" />%result = $EdScan(image_name, type, scope, name)
<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>])
<section end="syntax" /></p>
<p class="caption">$EdScan Function
</p>
</p>
<p class="caption">%result is a 0 or to an error code.</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>The first argument is a string identifying an image to receive returned data. This image must have the following format :
<li><var class="term">type</var> is a string indicating the type of entity for which information is to be returned. Valid types are:
<p class="code"> IMAGE EB_IMAGE
<table class="thJustBold">
LOOP_VAR IS BINARY LEN 4
NAME    IS STRING LEN 8
SCOPE    IS STRING LEN 6
TYPE    IS STRING LEN 8
* THIS SECTION USED JUST FOR DATASETS + ALLOCATES
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 PRINTERS + PUNCHES
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 LINKS
TRANSPORT  IS STRING LEN 8 AT DSNAME
PROTOCOL    IS STRING LEN 8
* THIS SECTION JUST USED FOR PROCESSES
DESTINATION IS STRING LEN 8 AT DSNAME
PARTNER    IS STRING LEN 10
MODE        IS STRING LEN 4
* THIS SECTION JUST USED FOR PROCESSGROUPS
LINK        IS STRING LEN 8 AT DSNAME
REMOTEID    IS STRING LEN 8
TERMINAL    IS STRING LEN 8
END IMAGE
</p>
ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.
<li>The second argument is a string indicating the type of entity for which information is to be returned. Valid types are
<table class="syntaxTable">
<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>The third argument 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.  
This is an optional argument. </p></li>
<li>The fourth argument 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><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 indicated by argument 1, LOOP_VAR must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, <var>$EdScan</var> will set LOOP_VAR to the number of entries skipped plus one if an entity is returned and to the number of entries skipped if not. Thus, multiple invocations of <var>$EdScan</var> without setting LOOP_VAR will return information on all appropriate entities.<p>
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.
  0 - Entity found, image set
 
  4 - Entity not found, or off end of chain
===Status codes===
  8 - Invalid argument 1 or argument 2
<p class="code"> 0 - Entity found, image set
12 - Argument 4 specified without argument 2 or 3
4 - Entity not found, or off end of chain
16 - Image specified by argument 1 not found
8 - Invalid argument 1 or argument 2
20 - Image specified by argument 1 not active, or too short
12 - Argument 4 specified without argument 2 or 3
</p>
16 - Image specified by argument 1 not found
<p class="caption">$EdScan return codes
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"> B
<p class="code">begin
IMAGE JUNK
image junkEntity
LOOP_VAR IS BINARY LEN 4
var is binary len 4
  ...
  ...
END IMAGE
end image
   
   
PREPARE IMAGE JUNK
prepare image junkEntity
REPEAT FOREVER
repeat forever
%RC = $EdScan('JUNK', 'ALLOCATE', 'SYSTEM')
  <!-- Note that the first arg is intentionally shown with different casing than the image declaration: -->
IF %RC ^= 0 THEN
  %rc = $edScan('junkentity', 'ALLOCATE', 'SYSTEM')
STOP
  if %rc then
END IF
      stop
PRINT %JUNK:NAME AND %JUNK:DSNAME
  end if
END REPEAT
  print %junk:name and %junk:dsname
END
end repeat
end
</p>
</p>


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<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>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $EdScan
</p>


[[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, and disp 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

Products authorizing $EdScan