$EdScan: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 17: Line 17:
<ul>
<ul>
<li>The first argument is a string identifying an image to receive returned data. This image must have the following format :
<li>The first argument is a string identifying an image to receive returned data. This image must have the following format :
<p class="code"> IMAGE EB_IMAGE
<p class="code">image entity
  LOOP_VAR IS BINARY LEN 4
loopVar is binary len 4
NAME     IS STRING LEN 8
name     is string len 8
SCOPE   IS STRING LEN 6
scope   is string len 6
TYPE     IS STRING LEN 8
type     is string len 8
  * THIS SECTION USED JUST FOR DATASETS + ALLOCATES
   
DSNAME   IS STRING LEN 44
* This section used just for DATASET + ALLOCATE:
DSORG   IS STRING LEN 10
dsname   is string len 44
ALLOC   IS STRING LEN 4
dsorg   is string len 10
DISP     IS STRING LEN 5
alloc   is string len 4
  * THIS SECTION JUST USED FOR PRINTERS + PUNCHES
disp     is string len 5
CLASS   IS STRING LEN 1
   
ROUTE   IS STRING LEN 8
* This section just used for PRINTER + PUNCH:
ID       IS STRING LEN 8
class   is string len 1
DIST     IS STRING LEN 8
route   is string len 8
FORMS   IS STRING LEN 8
id       is string len 8
  * THIS SECTION JUST USED FOR LINKS
dist     is string len 8
TRANSPORT   IS STRING LEN 8 AT DSNAME
forms   is string len 8
PROTOCOL   IS STRING LEN 8
   
  * THIS SECTION JUST USED FOR PROCESSES
* This section just used for LINK:
DESTINATION IS STRING LEN 8 AT DSNAME
transport   is string len 8 at dsname
PARTNER     IS STRING LEN 10
protocol   is string len 8
MODE       IS STRING LEN 4
   
  * THIS SECTION JUST USED FOR PROCESSGROUPS
* This section just used for PROCESS:
LINK       IS STRING LEN 8 AT DSNAME
destination is string len 8 at dsname
REMOTEID   IS STRING LEN 8
partner     is string len 10
TERMINAL   IS STRING LEN 8
mode       is string len 4
END IMAGE
   
* 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
</p>
</p>
ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.  
ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.  

Revision as of 12:01, 26 July 2017

Scan list of entities in online

Note: Most Sirius $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 204 datasets, 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(image_name, [type], [scope], [name])

%result is a 0 or to an error code.

  • The first argument 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 will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.

  • The second argument 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.

  • 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.
  • 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.

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, $EdScan 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 $EdScan without setting LOOP_VAR will 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.

B IMAGE JUNK LOOP_VAR IS BINARY LEN 4 ... END IMAGE PREPARE IMAGE JUNK REPEAT FOREVER %RC = $EdScan('JUNK', 'ALLOCATE', 'SYSTEM') IF %RC ^= 0 THEN STOP END IF PRINT %JUNK:NAME AND %JUNK:DSNAME END REPEAT END

Products authorizing $EdScan