$EdScan: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Scan list of entities in online<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Scan list of entities in online<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $EdScan function is [[to be entered]].</p>
<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>


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 204 datasets, sequential files or streams, printers, punches or processes.  
Line 19: Line 19:
<p class="code"> IMAGE EB_IMAGE
<p class="code"> IMAGE EB_IMAGE
  LOOP_VAR IS BINARY LEN 4
  LOOP_VAR 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
  * THIS SECTION USED JUST FOR DATASETS + ALLOCATES
  DSNAME IS STRING LEN 44
  DSNAME   IS STRING LEN 44
  DSORG IS STRING LEN 10
  DSORG   IS STRING LEN 10
  ALLOC IS STRING LEN 4
  ALLOC   IS STRING LEN 4
  DISP IS STRING LEN 5
  DISP     IS STRING LEN 5
  * THIS SECTION JUST USED FOR PRINTERS + PUNCHES
  * THIS SECTION JUST USED FOR PRINTERS + PUNCHES
  CLASS IS STRING LEN 1
  CLASS   IS STRING LEN 1
  ROUTE IS STRING LEN 8
  ROUTE   IS STRING LEN 8
  ID IS STRING LEN 8
  ID       IS STRING LEN 8
  DIST IS STRING LEN 8
  DIST     IS STRING LEN 8
  FORMS IS STRING LEN 8
  FORMS   IS STRING LEN 8
  * THIS SECTION JUST USED FOR LINKS
  * THIS SECTION JUST USED FOR LINKS
  TRANSPORT IS STRING LEN 8 AT DSNAME
  TRANSPORT   IS STRING LEN 8 AT DSNAME
  PROTOCOL IS STRING LEN 8
  PROTOCOL   IS STRING LEN 8
  * THIS SECTION JUST USED FOR PROCESSES
  * THIS SECTION JUST USED FOR PROCESSES
  DESTINATION IS STRING LEN 8 AT DSNAME
  DESTINATION IS STRING LEN 8 AT DSNAME
  PARTNER IS STRING LEN 10
  PARTNER     IS STRING LEN 10
  MODE IS STRING LEN 4
  MODE       IS STRING LEN 4
  * THIS SECTION JUST USED FOR PROCESSGROUPS
  * THIS SECTION JUST USED FOR PROCESSGROUPS
  LINK IS STRING LEN 8 AT DSNAME
  LINK       IS STRING LEN 8 AT DSNAME
  REMOTEID IS STRING LEN 8
  REMOTEID   IS STRING LEN 8
  TERMINAL IS STRING LEN 8
  TERMINAL   IS STRING LEN 8
  END IMAGE
  END IMAGE
</p>
</p>
Line 66: Line 66:
<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>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.
</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, $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.<p>
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.<p>
0 - Entity found, image set
  0 - Entity found, image set
4 - Entity not found, or off end of chain
  4 - Entity not found, or off end of chain
8 - Invalid argument 1 or argument 2
  8 - Invalid argument 1 or argument 2
  12 - Argument 4 specified without argument 2 or 3
  12 - Argument 4 specified without argument 2 or 3
  16 - Image specified by argument 1 not found
  16 - Image specified by argument 1 not found
Line 78: Line 77:
<p class="caption">$EdScan return codes
<p class="caption">$EdScan return codes
</p>
</p>


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.
Line 112: Line 110:
<p class="caption">Products authorizing $EdScan
<p class="caption">Products authorizing $EdScan
</p>
</p>


[[Category:$Functions|$EdScan]]
[[Category:$Functions|$EdScan]]

Revision as of 20:56, 31 January 2011

<section begin="desc" />Scan list of entities in online<section end="desc" />

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

<section begin="syntax" /> %RESULT = $EdScan(image_name, type, scope, name) <section end="syntax" />

$EdScan Function

%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 EB_IMAGE 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

    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.

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

$EdScan return codes

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